Forum Discussion
Anonymous
6 years agoNot applicable
Week over Week change %
Hello,
I need to calculate Week over Week change %.
i write the following DAX but red highlighted one has Error.
How should i change the expression?
Week change =
VAR lastweekamount =
CALCULATE(
SUM(Power_BI_Book_Coin[R_Coin_Cnt]),
FILTER(
ALL(Power_BI_Book_Coin),
RELATED('Date'[WeekYear]
= MIN('Date'[WeekYear]-1))
)
)
RETURN
IF(lastweekamount = 0, "N/A",
DIVIDE(SUM(Power_BI_Book_Coin[R_Coin_Cnt]) - lastweekamount, lastweekamount, 0)
)
Thanks.
- Anonymous6 years ago
Hi Anonymous ,
Please use the below formula
Measure = VAR lastWeekAmount = CALCULATE ( SUM ( Value Sum), FILTER ( ALL ( 'Calendar' ), 'Calendar'[WeekNum] = MIN ( 'Calendar'[WeekNum] ) - 1 ) ) RETURN DIVIDE ( SUM ( Value Sum ) - lastWeekAmount, lastWeekAmount, 0 )Regards,
Gaurav Raj Singh
LinkedIN : https://www.linkedin.com/in/gauravrajsingh/
8 Replies
- AnonymousNot applicable
Hi Anonymous ,
Please use the below formula
Measure = VAR lastWeekAmount = CALCULATE ( SUM ( Value Sum), FILTER ( ALL ( 'Calendar' ), 'Calendar'[WeekNum] = MIN ( 'Calendar'[WeekNum] ) - 1 ) ) RETURN DIVIDE ( SUM ( Value Sum ) - lastWeekAmount, lastWeekAmount, 0 )Regards,
Gaurav Raj Singh
LinkedIN : https://www.linkedin.com/in/gauravrajsingh/
- AnonymousNot applicable
Thank you very much for your help^^
- AnonymousNot applicable
Anonymous
it worked ?