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

Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM. Register now.

Reply
Anonymous
Not applicable

How do I create a slicer to filter 2 column headers?

Hi all, I am really stuck trying to create 1 slicer that can filter the 'Lag1' and 'Lag2' columns for a matrix visual.

Basically, the slicer should have only 2 options - 1) Lag1 and 2) Lag2. When the user clicks on "Lag1" for example, only rows that are labelled "Lag1" should be filtered. I cannot concat the 2 columns as there are overlaps, some Lag1s are also Lag2s. Can I ask if this is possible? Or how else should I go about making this slicer?

sophhhlee_0-1626854397895.png

 

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi @Anonymous ,

 

Since your data is simple, just create the following seperate table

7.png

 

Then create a measure

Lag = SWITCH(SELECTEDVALUE('Table (2)'[Category]),"Lag1","Lag1","Lag2","Lag2")

8.png9.png

 

 

Best Regards,

Stephen Tao

 

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

5 REPLIES 5
Anonymous
Not applicable

Hi @Anonymous ,

 

Since your data is simple, just create the following seperate table

7.png

 

Then create a measure

Lag = SWITCH(SELECTEDVALUE('Table (2)'[Category]),"Lag1","Lag1","Lag2","Lag2")

8.png9.png

 

 

Best Regards,

Stephen Tao

 

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

Anonymous
Not applicable

hello @Anonymous although this post has been a while, but I think it is very useful and would like to know this same method could also apply to the headers where contains the same string. like lag1-a, lag1-b, lag1-c; lag2-a,lag2-b, lag2-c?  Thanks in advance.

amitchandak
Super User
Super User

@Anonymous , You need to create independent table

 

leg =

Distinct(union(

summarize(Table, [Leg1], "Name", "Leg1"),

summarize(Table, [Leg2], "Name", "Leg2")

))

 

You can use this as an independent filter 

 

example measure 

Switch( selectedvalues(leg[Name]) , //Name is leg1

"Leg1" , calculate(countrows(Table), filter(Table[leg1] in values(Leg[Leg1]))),

"Leg2" , calculate(countrows(Table), filter(Table[leg2] in values(Leg[Leg1]))) //name leg 1 in new table

)

 

 

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube
Anonymous
Not applicable

@amitchandak hmm where would I insert the measure? as a visual level filter?

@Anonymous , slicer or filter should come from leg table. 

 

measure you should in filter as value 

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

Helpful resources

Announcements
Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

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

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.