The ultimate Fabric, Power BI, SQL, and AI community-led learning event. Save €200 with code FABCOMM.
Get registeredCompete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.
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 the previous one but it's static so it will only get me the MoM% vs the last month of the calendar (right now March vs April).
Solved! Go to Solution.
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.
Hi @J_Mug ,
If you've fixed the issue on your own please kindly share your solution. If the above posts help, please kindly mark it as a solution to help others find it more quickly. Thanks!
Best Regards,
Yingjie Li
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.
@J_Mug it should work , did you tested it, what is not working?
Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!
Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo
If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤
Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.