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

Be one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch 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!

ArunFabCon

Microsoft Fabric Community Conference 2025

Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.

December 2024

A Year in Review - December 2024

Find out what content was popular in the Fabric community during 2024.