Reply
SBR1D
Helper III
Helper III
Partially syndicated - Outbound

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

Syndicated - Outbound

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

Syndicated - Outbound

Thank you very much

newtodax
Frequent Visitor

Syndicated - Outbound

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")

avatar user

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

FebPBI_Carousel

Power BI Monthly Update - February 2025

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

Feb2025 NL Carousel

Fabric Community Update - February 2025

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

Top Solution Authors (Last Month)
Top Kudoed Authors (Last Month)