Forum Discussion

gsandip's avatar
gsandip
Frequent Visitor
3 years ago
Solved

PREVIOUSMONTH() function does not working for me

Hi,

I have written PREVIOUSMONTH() in below measure:

Previous Month Sales =
VAR vSales = CALCULATE(
sum(Orders[Sales]), PREVIOUSMONTH('Calendar'[Date])
)
RETURN
IF(vSales = blank(), 0, vSales)
 
But, it is not working properly like below:

which you can see is incorrent, but when I add Year from my calendar, then year wise and monthwise it is showing correct result like below:

So, why it is hapenning here? actually I don't want to use Year column in my table and want the correct result, but it is showing wrong when I remove Year column from table.


 

 

3 Replies