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

Power BI is turning 10! Let’s celebrate together with dataviz contests, interactive sessions, and giveaways. Register now.

Reply
billybob12
Regular Visitor

Creating a slicer that filters across two columns

I would like to create a slicer that pulls through all all records if they have a value in one of two columns. For example if the below data was in PowerBi, if I selected "Red" it would pull through User 1, 5 and 6 records. Is this possible?

 

UserPrimary ColourSecondary Colour
1Red 
2Yellow 
3BlueGreen
4GreenYellow
5PurpleRed
6OrangeRed
1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi, @billybob12 

I am glad to help you.

 

You can follow the steps below and hopefully it will help you!

 

First, you need to create a Custom Column Combined Colour in Power Query:

vfenlingmsft_0-1734313226932.png

 

if [Primary Colour] = null then [Secondary Colour] 
else if [Secondary Colour] = null then [Primary Colour] 
else [Primary Colour] & "," & [Secondary Colour]

 

vfenlingmsft_2-1734313418107.png

 

Then create another Custom Column Colors:

vfenlingmsft_1-1734313288210.png

 

Text.Split([Combined Colour],",")

 

vfenlingmsft_3-1734313436571.png

 

Click Expand to Rows:

vfenlingmsft_4-1734313469094.png

 

vfenlingmsft_5-1734313496322.png

 

You can drag the Custom Column Colors to the Field in Slicer to filter the data:

vfenlingmsft_6-1734313598531.png

 

I've attached the pbix file for this example below, hope it helps!

 

 

I hope my suggestions give you good ideas, if you have any more questions, please clarify in a follow-up reply.
Best Regards,
Fen Ling,
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

2 REPLIES 2
Anonymous
Not applicable

Hi, @billybob12 

I am glad to help you.

 

You can follow the steps below and hopefully it will help you!

 

First, you need to create a Custom Column Combined Colour in Power Query:

vfenlingmsft_0-1734313226932.png

 

if [Primary Colour] = null then [Secondary Colour] 
else if [Secondary Colour] = null then [Primary Colour] 
else [Primary Colour] & "," & [Secondary Colour]

 

vfenlingmsft_2-1734313418107.png

 

Then create another Custom Column Colors:

vfenlingmsft_1-1734313288210.png

 

Text.Split([Combined Colour],",")

 

vfenlingmsft_3-1734313436571.png

 

Click Expand to Rows:

vfenlingmsft_4-1734313469094.png

 

vfenlingmsft_5-1734313496322.png

 

You can drag the Custom Column Colors to the Field in Slicer to filter the data:

vfenlingmsft_6-1734313598531.png

 

I've attached the pbix file for this example below, hope it helps!

 

 

I hope my suggestions give you good ideas, if you have any more questions, please clarify in a follow-up reply.
Best Regards,
Fen Ling,
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

 

Tutu_in_YYC
Super User
Super User

An option is to transform that table to the following:

Tutu_in_YYC_0-1733247326236.png


You will be duplicating the rows, because a user may have 2 colours. But now the colours are in the same column, then you can filter normally.

Out-of-the-box slicer in PBI is not able to combine 2 columns. Check if there are custom visual slicer in the marketplace that can do that.

Helpful resources

Announcements
June 2025 Power BI Update Carousel

Power BI Monthly Update - June 2025

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

June 2025 community update carousel

Fabric Community Update - June 2025

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