Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
6 years ago

Comparing sales with last year

Hi Guys,

               I need to compare the current year MTD sales vs Last year same month MTD sales i.e say Current month is march 2019, I need to compare Current year march 2019 with last year march 2018 Dynamically. i used a dax expression as

MTD_CY = CALCULATE(DISTINCTCOUNT(Statement[name]),DATESMTD(Date[Date]))

MTD_LY = CALCULATE(DISTINCTCOUNT(Statement[name]),DATESYTD(DATEADD(Date[Date],-1,YEAR)))

 

But when i use this Dax i can get values for the current year say 2019 but my last year valus 2018 shows blank. I connecting the datasource with SQL in the Direct Query mode. Please help me and provide a solution.

11 Replies