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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply
SBR1D
Helper III
Helper III

How to ignore blank values in switch statement

Hello

 

I am using a switch statement which is working fine except for if the result if 0 where it seems to pick up blank values. I have tried adding the ISBLANK function but it does not solve  the problem. 

 

no date this month / last month / 2 months = SWITCH(
    TRUE, 'Learning Plan'[month since last activity]= 0 , "Activity in this month",
        'Learning Plan'[month since last activity] = -1 , "Activity last month",
        'Learning Plan'[month since last activity] = -2 , "Last activity two months ago",
        iSBLANK('Learning Plan'[month since last activity]), "Last compliance active learning is blank",
        "no data")
     
1 ACCEPTED SOLUTION
newtodax
Frequent Visitor

Try this and let me know if that works for you 

no date this month / last month / 2 months = SWITCH('Learning Plan'[month since last activity],
0, "Activity in this month",
-1, "Activity last month",
-2, "Last activity two months ago",
BLANK(), "Last compliance active learning is blank",
"no data")

View solution in original post

2 REPLIES 2
SBR1D
Helper III
Helper III

Thank you very much

newtodax
Frequent Visitor

Try this and let me know if that works for you 

no date this month / last month / 2 months = SWITCH('Learning Plan'[month since last activity],
0, "Activity in this month",
-1, "Activity last month",
-2, "Last activity two months ago",
BLANK(), "Last compliance active learning is blank",
"no data")

Helpful resources

Announcements
July 2025 community update carousel

Fabric Community Update - July 2025

Find out what's new and trending in the Fabric community.

July PBI25 Carousel

Power BI Monthly Update - July 2025

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