Forum Discussion
J_Mug
Helper I
6 years agoDynamic Month Over Month with filters
Hi, I wanted to know if it's possible to have a dynamic calculation of MoM/YoY % to change with date filters. Right now I have this measure and it returns correctly the current month change vs t...
- 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.