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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
SBR1D
Helper I
Helper I

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 I
Helper I

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
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

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