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
RolandPlanet
Frequent Visitor

Need help building a slicer off of column combinations

I've been trying to create a slicer so I can filter my data based on values in two columns.
Here's a sample of the data I have in my table:

Dog OwnerCat Owner
yesno
yesno
yesyes
nono
noyes
noyes
nono
nono
nono
yesno
yesno
noyes
yesno
yesno
noyes
nono
nono

 

I'd like to create a slicer so that I can filter this data based on these choices which relate to specific conditions:

I originally tried to create a column, but learned I can't create a column that uses a switch off of a dynamic value. Is there another way to do it? 

Slicer IDSlicer valuesFilter conditions
1Dog owner, include cat owners[Dog Owner] = "yes"
2Cat Owners Only[Cat Owner]="yes" and [Dog Owner]<>"yes"
3Dog and cat owners[Cat Owner]="yes" and [Dog Owner]="yes"
4All 
1 ACCEPTED SOLUTION
v-yohua-msft
Community Support
Community Support

Hi, @RolandPlanet 

Maybe you can create a calculated column and try the following dax:

Slicer Category = 
SWITCH(
    TRUE(),
    [Dog Owner] = "yes" && [Cat Owner] = "yes", "Dog and cat owners",
    [Dog Owner] = "yes", "Dog owner, include cat owners",
    [Cat Owner] = "yes", "Cat Owners Only",
    "All"
)

 Then create a new table:

Table 2 = SUMMARIZE('Table','Table'[Slicer Category],"Index",RANKX(ALLSELECTED('Table'),'Table'[Slicer Category],,DESC,Dense))

vyohuamsft_2-1715843115686.png

 

Here is my preview:

vyohuamsft_0-1715842174592.png

 

vyohuamsft_3-1715843193880.png

 

How to Get Your Question Answered Quickly 

Best Regards

Yongkang Hua

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

3 REPLIES 3
v-yohua-msft
Community Support
Community Support

Hi, @RolandPlanet 

Maybe you can create a calculated column and try the following dax:

Slicer Category = 
SWITCH(
    TRUE(),
    [Dog Owner] = "yes" && [Cat Owner] = "yes", "Dog and cat owners",
    [Dog Owner] = "yes", "Dog owner, include cat owners",
    [Cat Owner] = "yes", "Cat Owners Only",
    "All"
)

 Then create a new table:

Table 2 = SUMMARIZE('Table','Table'[Slicer Category],"Index",RANKX(ALLSELECTED('Table'),'Table'[Slicer Category],,DESC,Dense))

vyohuamsft_2-1715843115686.png

 

Here is my preview:

vyohuamsft_0-1715842174592.png

 

vyohuamsft_3-1715843193880.png

 

How to Get Your Question Answered Quickly 

Best Regards

Yongkang Hua

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Fthrs_Analytics
Frequent Visitor

To clarify, does Slicer ID correspond to Dog Owner does not equal no? All other values are accepted?

Sorry for the confusion - I created a table called 'Slicer Table' and had an 'ID' column and 'Value' column.

I added the 'ID' column because I was trying to create a calculated column to set a value based on SELECTED('Slicer Table'[ID]) and the value in each row for 'Dog Owner' and 'Cat Owner'.  

 

 

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!

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.