Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now

Reply
ArchStanton
Impactful Individual
Impactful Individual

Month on Month appears in Year column

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.

 

ArchStanton_0-1706024058485.png

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!

1 ACCEPTED SOLUTION
Ahmedx
Super User
Super User

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)

View solution in original post

3 REPLIES 3
Anonymous
Not applicable

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.

vkongfanfmsft_0-1706086106116.png

 

 

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

Ahmedx
Super User
Super User

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)
ArchStanton
Impactful Individual
Impactful Individual

This works perfectly - thank you so much!

Helpful resources

Announcements
November Power BI Update Carousel

Power BI Monthly Update - November 2025

Check out the November 2025 Power BI update to learn about new features.

Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Solution Authors
Top Kudoed Authors