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

Don't miss out! 2025 Microsoft Fabric Community Conference, March 31 - April 2, Las Vegas, Nevada. Use code MSCUST for a $150 discount. Prices go up February 11th. Register now.

Reply
Cheezeduckies
Frequent Visitor

Switch Selected Value for no selected value

So I have a working switch statement for a selected value, with two options, but I was wondering if I could get a third switch statement working for if neither option is selected.

 

the Slicer has option A and B, so I want my formula to work for A and B and neither option pressed. 

 

Currently I have: 

 

SWITCH(SELECTEDVALUE(Choice),"A",SUM(X),"B",sum(Y),"",SUM(Z))
 
so I have tried with "" but when I press no options on the slicer, nothing appears in the graph, can anyone please advise?
1 ACCEPTED SOLUTION
ravsha85
Frequent Visitor

Hi @Cheezeduckies  could you please try this

 

SWITCH(
TRUE(),
SELECTEDVALUE(Choice) = "A", SUM(X),
SELECTEDVALUE(Choice) = "B", SUM(Y),
TRUE(), SUM(Z)
)

View solution in original post

3 REPLIES 3
ravsha85
Frequent Visitor

Hi @Cheezeduckies  could you please try this

 

SWITCH(
TRUE(),
SELECTEDVALUE(Choice) = "A", SUM(X),
SELECTEDVALUE(Choice) = "B", SUM(Y),
TRUE(), SUM(Z)
)

This syntax works better than most I've tried, but mine doesn't switch to the last option when nothing is selected?

That Worked! Thanks So Much. 

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! Prices go up Feb. 11th.

Jan25PBI_Carousel

Power BI Monthly Update - January 2025

Check out the January 2025 Power BI update to learn about new features in Reporting, Modeling, and Data Connectivity.

Jan NL Carousel

Fabric Community Update - January 2025

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

Users online (2,500)