Forum Discussion
Dynamic Month Over Month with filters
- 6 years ago
Hi J_Mug ,
I don't know the structure of your dataset but the logic of the measure should work fine. Have you tested the measure in your report?
Or you can modify the measure like this but I'm not certain:
Response MoM% = VAR _BASELINE_VALUE = CALCULATE ( COUNT ( NPS[Ratings] ), DATESMTD ( DATEADD ( Calendary[Date], -1, MONTH ) ) ) VAR _VALUE_TO_COMPARE = TOTALMTD ( COUNT ( NPS[Ratings] ), ALLSELECTED ( Calendary[Date] ) ) RETURN IF ( _VALUE_TO_COMPARE > _BASELINE_VALUE, ABS ( DIVIDE ( _VALUE_TO_COMPARE - _BASELINE_VALUE, _BASELINE_VALUE, 0 ) ), - ABS ( DIVIDE ( _VALUE_TO_COMPARE - _BASELINE_VALUE, _BASELINE_VALUE, 0 ) ) )If the above not help, could you please share a sample file for further discussion? Sample data and expected output would help tremendously.
Please see this post regarding How to Get Your Question Answered Quickly:
https://community.powerbi.com/t5/Community-Blog/How-to-Get-Your-Question-Answered-Quickly/ba-p/38490Best Regards,
Yingjie LiIf this post helps then please consider Accept it as the solution to help the other members find it more quickly.
Hi J_Mug ,
I don't know the structure of your dataset but the logic of the measure should work fine. Have you tested the measure in your report?
Or you can modify the measure like this but I'm not certain:
Response MoM% =
VAR _BASELINE_VALUE =
CALCULATE (
COUNT ( NPS[Ratings] ),
DATESMTD ( DATEADD ( Calendary[Date], -1, MONTH ) )
)
VAR _VALUE_TO_COMPARE =
TOTALMTD ( COUNT ( NPS[Ratings] ), ALLSELECTED ( Calendary[Date] ) )
RETURN
IF (
_VALUE_TO_COMPARE > _BASELINE_VALUE,
ABS ( DIVIDE ( _VALUE_TO_COMPARE - _BASELINE_VALUE, _BASELINE_VALUE, 0 ) ),
- ABS ( DIVIDE ( _VALUE_TO_COMPARE - _BASELINE_VALUE, _BASELINE_VALUE, 0 ) )
)If the above not help, could you please share a sample file for further discussion? Sample data and expected output would help tremendously.
Please see this post regarding How to Get Your Question Answered Quickly:
https://community.powerbi.com/t5/Community-Blog/How-to-Get-Your-Question-Answered-Quickly/ba-p/38490
Best Regards,
Yingjie Li
If this post helps then please consider Accept it as the solution to help the other members find it more quickly.