Forum Discussion
Anonymous
6 years agoNot applicable
Create a slicer with Column Headers
Is it possible to create a slicer with column headers? I would Like to create a drop down slicer that only shows header names and not values ( Line Rate, Accessorial Rate, Hourly Rate, Non- Hou...
- 6 years ago
Anonymous You can use power query to create this - please replace TheTable below to the name of your table.
On the Advanced editor, create a blank query and use this code:
let Source = Table.ColumnNames(TheTable as table) as list, #"Converted to Table" = Table.FromList(Source, null, {"TheHeaders"}) in #"Converted to Table"
v-kelly-msft
Community Support
6 years agoHi Anonymous ,
I will show you another way:
Go to query editor>right click on table name in the "Queries">"Duplicate":
Select all the columns >unpivot the columns:
Then "Apply and close" and back to data view,create a new table using below dax expression:
Slicer table = DISTINCT('Table (2)'[Attribute])
And you will see:
For the related .pbix file,pls click here.
Best Regards,
Kelly
Did I answer your question? Mark my post as a solution!
edhans
Community Champion
6 years agoI love power query. Always about 5 ways to get many things done. Mine took the "only use the UI approach" but with come M coding, can be done in fewer setps.