DateAdd/SamePeriodLY Not returning correct results

Hello Team Enterprise DNA and members, this is so weird and i have tried to solve this issue since yesterday but at a point where i can use some help…

All i am trying to do is to show CY(current year) alongside PY(previous year) using calculate/dateadd

Here the calc used
PYData =
CALCULATE(SUM(FactSales[AmountAvgUSD]),DATEADD(DimTime[Date],-1,YEAR))

This works fine and does produce right results as long as i have date( date dimension) in the table as shown in the image below

image

But as soon as i add month year (also from date dimension), i dont see the values for PY field anymore, although there is data

image

Although there is data
image

If i use date slicer as shown in the image, the PY function works fine
image

but as soon as i use ‘Year’ field (from date table - data type of year is string, tried to change the datatype to whole number but results are same), the PY data disappears…
image

Have tried 'SamePeriodLastYear and ParellelPeriod functions too and they are not producing desired result, anyone else here faced similar issues? thanks in advance…

Hi @sanappi09

My understanding of time intelligent functions is that they rely on date tables with a date columns having daily dates, no gaps. Not sure if what you are doing violates this principle but it will help if you post a sample of your report (It’s hard to read some of the images you posted)

Cheers

thanks for the response Bare… There is something wrong with this one file, probably corrupted…

I ended up creating a new file where in the same measures, along with the date dimension work just fine.

Strange one, agreed. But desired result in the end :slight_smile: