Forum Discussion
Anonymous
3 years agoNot applicable
calculating difference
Hi, I am stucked with the following question. Product Code Sales Date A 10 01/02/2022 B 10 01/02/2022 C 10 01/02/2022 D 10 01/02/2022 A 10 01/03/2022 A 10 ...
- Anonymous3 years ago
Hi,
I am not sure what's wrong with my equation as it keep return error message.
MoM Revenue Growth =VAR _Actual =sum('Table'[Sales])VAR _PrevMonth =CALCULATE(CALCULATE(sum('Table'[Sales])),PREVIOUSMONTH ('Table'[Date]))RETURN_Actual - _ PrevMonthDo you know what I did wrong?Thanks!
PabloDeheza
3 years agoSolution Sage
Hey there!
Try this:
MoM Revenue Growth =
VAR _Actual =
Total
VAR _PrevMonth =
CALCULATE(
Total,
PREVIOUSMONTH( YourDateColumn )
)
RETURN
_Actual - _ PrevMonth
Let me know if that helps!
Anonymous
3 years agoNot applicable
Hi,
I am not sure what's wrong with my equation as it keep return error message.
MoM Revenue Growth =
VAR _Actual =
sum('Table'[Sales])
VAR _PrevMonth =
CALCULATE(
CALCULATE(sum('Table'[Sales])),
PREVIOUSMONTH ('Table'[Date])
)
RETURN
_Actual - _ PrevMonth
Do you know what I did wrong?
Thanks!
- PabloDeheza3 years agoSolution Sage
Can you please provide the error message you are getting? Thanks
- Anonymous3 years agoNot applicable
The error message is like below:
The syntax for 'PrevMonth' is incorrect. (DAX(VAR _Actual = sum(''Table'[Sales])VAR _PrevMonth = CALCULATE( CALCULATE(sum('Table'[Sales])), PREVIOUSMONTH ('Table'[Date]) )RETURN _Actual - _ PrevMonth)).
- tamerj13 years agoCommunity Champion
Anonymous
You have a space before PrevMonth. Delete it