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

Join us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. Register now.

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
Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 Power BI Update Carousel

Power BI Monthly Update - June 2025

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

June 2025 community update carousel

Fabric Community Update - June 2025

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