Forum Discussion
Dimitris_Kats
4 years agoHelper V
Error with DateAdd
Dear members Hello I am calculating the Current Month Sales amount: CM Sales = CALCULATE(SUM(Sales[Sales])) Also the Previous Month Sales PM Sales = CALCULATE(SUM(Sales[Sales]), DATEADD(Time[M...
- Anonymous4 years ago
Hi Dimitris_Kats ,
Try to sumx your original measure to get correct result in total.
PM Sales with correct Total = SUMX(VALUES('Time'[Month]),[PM Sales])Sales Dif with correct Total = SUMX(VALUES('Time'[Month]),[Sales Dif])Result is as below.
Best Regards,
Rico ZhouIf this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Dimitris_Kats
4 years agoHelper V
Hello amitchandak and thank you very much for your reply.
I am using a date table for this measure . I use the month column from the date table wich is formatted as date.
This is not the problem 🙂
tamerj1
4 years agoCommunity Champion
The explanation provided by amitchandak is correct. DATEADD deals with a column of unique date values. The month column even if formatted as date is not unique. Use the date column with DATEADD or YearMonth Number column and subtract 1