Forum Discussion
tomcch
2 years agoFrequent Visitor
Single Slicer to Filter Multiple Columns
Hi, i am a beginner of Power BI. I have data like below. I would like to create a slicer to allow user to filter shipment that involve a particular party. If filter = "A", then result should be sh...
- 2 years ago
Hi Tomcch,
I was actually curious about this so I decided to have a go at it. I found a video online and worked through it and got it to work! Here's what you need to do:
1. Add a calculated column to your shipments table.Key = COMBINEVALUES( "|" , Shipments[Agent] , Shipments[Consignee] , Shipments[End Customer] , Shipments[Payee] , Shipments[Shipper] )
2. Create a new calculated table.Slicer =DISTINCT(UNION(SELECTCOLUMNS( Shipments , "Selection" , Shipments[Agent] , "Key" , Shipments[Key] ) ,SELECTCOLUMNS( Shipments , "Selection" , Shipments[Consignee] , "Key" , Shipments[Key] ) ,SELECTCOLUMNS( Shipments , "Selection" , Shipments[End Customer] , "Key" , Shipments[Key] ) ,SELECTCOLUMNS( Shipments , "Selection" , Shipments[Payee] , "Key" , Shipments[Key] ) ,SELECTCOLUMNS( Shipments , "Selection" , Shipments[Shipper] , "Key" , Shipments[Key] )))
3. Establish a relationship between the tables on Key, set to bi-directional filtering.
4. On your report canvas, add a slicer using the "Selection" field.And you are rockin' and rollin'!
CoreyP
2 years agoSolution Sage
Hi Tomcch,
I was actually curious about this so I decided to have a go at it. I found a video online and worked through it and got it to work! Here's what you need to do:
1. Add a calculated column to your shipments table.
Key = COMBINEVALUES( "|" , Shipments[Agent] , Shipments[Consignee] , Shipments[End Customer] , Shipments[Payee] , Shipments[Shipper] )
2. Create a new calculated table.
2. Create a new calculated table.
Slicer =
DISTINCT(
UNION(
SELECTCOLUMNS( Shipments , "Selection" , Shipments[Agent] , "Key" , Shipments[Key] ) ,
SELECTCOLUMNS( Shipments , "Selection" , Shipments[Consignee] , "Key" , Shipments[Key] ) ,
SELECTCOLUMNS( Shipments , "Selection" , Shipments[End Customer] , "Key" , Shipments[Key] ) ,
SELECTCOLUMNS( Shipments , "Selection" , Shipments[Payee] , "Key" , Shipments[Key] ) ,
SELECTCOLUMNS( Shipments , "Selection" , Shipments[Shipper] , "Key" , Shipments[Key] )
))
3. Establish a relationship between the tables on Key, set to bi-directional filtering.
3. Establish a relationship between the tables on Key, set to bi-directional filtering.
4. On your report canvas, add a slicer using the "Selection" field.
And you are rockin' and rollin'!
tomcch
2 years agoFrequent Visitor
would you mind giving me the working file for easy reference please?
thank you.