Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.
Register now!Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now
Hi,
Does anyone know how I can show the results of this measure just for Months and not the Year Total? I want the red BLANK so it only shows values for the months.
My code is:
Cases MoM% =
VAR ActiveCase = [YTD Active Cases]
VAR ActiveCasesPM = [Previous Mth]
VAR Result =
IF(
[YTD Active Cases] <> 0 && [YTD Active Cases PY] <> 0,
DIVIDE(ActiveCase - ActiveCasesPM, ActiveCasesPM)
)
RETURN
Result
Any help would be much appreciated!
Solved! Go to Solution.
pls try this
Cases MoM% =
VAR ActiveCase = [YTD Active Cases]
VAR ActiveCasesPM = [Previous Mth]
VAR Result =
IF(
[YTD Active Cases] <> 0 && [YTD Active Cases PY] <> 0,
DIVIDE(ActiveCase - ActiveCasesPM, ActiveCasesPM)
)
RETURN IF(HASONEVALUE('Date'[Month name]),Result)
Hi @ArchStanton ,
A common approach to this scenario is to use the IF+HASONEVALUE function.
Try to modify your dax code like below:
Cases MoM% =
VAR ActiveCase = [YTD Active Cases]
VAR ActiveCasesPM = [Previous Mth]
VAR Result =
IF(
HASONEVALUE('Date'[Month]), -- Check if the context is at the month level
IF(
[YTD Active Cases] <> 0 && [YTD Active Cases PY] <> 0,
DIVIDE(ActiveCase - ActiveCasesPM, ActiveCasesPM)
)
)
RETURN
Result
Also you can check the following example which will help you understand.
Best Regards,
Adamk Kong
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly
pls try this
Cases MoM% =
VAR ActiveCase = [YTD Active Cases]
VAR ActiveCasesPM = [Previous Mth]
VAR Result =
IF(
[YTD Active Cases] <> 0 && [YTD Active Cases PY] <> 0,
DIVIDE(ActiveCase - ActiveCasesPM, ActiveCasesPM)
)
RETURN IF(HASONEVALUE('Date'[Month name]),Result)
This works perfectly - thank you so much!
Check out the November 2025 Power BI update to learn about new features.
Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!