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
Anonymous
Not applicable

Multiple filter using switch true in allselected

I create new table where I defined names my filter (there is no relationship between dataset)

jopo12345678_0-1646148174464.png

Then I create measere

 
TRN =
SWITCH(
TRUE(),
"Online" IN ALLSELECTED(Channel_name[Channel]),Indicators[t_online],
"Dealer Shops" IN ALLSELECTED(Channel_name[Channel]), Indicators[t_dealer_shops],
"Own Shops" IN ALLSELECTED(Channel_name[Channel]), Indicators[t_own_shops],
"Biznis" IN ALLSELECTED(Channel_name[Channel]), Indicators[t_bz],
"TAM" IN ALLSELECTED(Channel_name[Channel]), Indicators[t_tam],
"0")
 

Measure works but once I chosee multiple value from filter it doest work. Can you please help how to change my code for multiple options?

 

 

 

 

 

 

 

 

1 ACCEPTED SOLUTION

@Anonymous , I think you need to provide more information. what I can think now is

 

if("Online" IN ALLSELECTED(Channel_name[Channel]),Indicators[t_online],0) +
if("Dealer Shops" IN ALLSELECTED(Channel_name[Channel]), Indicators[t_dealer_shops],0) +
if("Own Shops" IN ALLSELECTED(Channel_name[Channel]), Indicators[t_own_shops],0) +
if("Biznis" IN ALLSELECTED(Channel_name[Channel]), Indicators[t_bz],0) +
if("TAM" IN ALLSELECTED(Channel_name[Channel]), Indicators[t_tam],0)

View solution in original post

3 REPLIES 3
amitchandak
Super User
Super User

@Anonymous , I check this one and it working.

 

Measure = Switch(true(), "ABC" in ALLSELECTED('Table'[Column1]) , "A",
"DEF" in ALLSELECTED('Table'[Column1]) , "B",
"C")

 

but in case you expect two values, then you need a different way

 

Multiple if and append by &

Anonymous
Not applicable

For example 

I choose
"Online" and get TRN 127

jopo12345678_1-1646150368686.png

"Dealer Shops" and get TRN 702

 

jopo12345678_2-1646150443695.png

I need to have for example:

"Online" & "Dealer Shops" and get 829

jopo12345678_4-1646150667960.png

 

Do you have idea how to do it?

 

@Anonymous , I think you need to provide more information. what I can think now is

 

if("Online" IN ALLSELECTED(Channel_name[Channel]),Indicators[t_online],0) +
if("Dealer Shops" IN ALLSELECTED(Channel_name[Channel]), Indicators[t_dealer_shops],0) +
if("Own Shops" IN ALLSELECTED(Channel_name[Channel]), Indicators[t_own_shops],0) +
if("Biznis" IN ALLSELECTED(Channel_name[Channel]), Indicators[t_bz],0) +
if("TAM" IN ALLSELECTED(Channel_name[Channel]), Indicators[t_tam],0)

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.