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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
Julier
Helper III
Helper III

column headers as a slicer

Hello, I have my data in power query as below which i have a chart and a table  visual working from this,  i want to be able to slice the table and the chart with a slicer using the column headers, i have tried duplicating my table of data and unpivoting the columns to just have the headers however this will not link to my chart or table visual to work as a slicer, any help would be much appreciated.

HQQPFBDCSFFGMPGMonthSortTarget   
6664618394414930September93000   
6506644481954740October103000   
6144605189744788August83000   
6302624394185671July73000   
          
          
          
1 ACCEPTED SOLUTION
PhilipTreacy
Super User
Super User

@Julier 

 

Download this example PBIX file 

 

So what you are trying to do is only show the columns of data selected in the slicer?

 

You can use a Field Parameter for this.

 

From the Modelling menu -> New Parameter -> Fields and add the Fields (columns)

 

PhilipTreacy_0-1762670854640.png

 

make sure the check box 'Add slicer to this page' is checked and click Create

 

Create a table and add the parameter you just created, use the slicer to display the columns you want

 

PhilipTreacy_1-1762670929105.png

 

 

Regards

 

Phil



Did I answer your question? Then please mark my post as the solution.
If I helped you, click on the Thumbs Up to give Kudos.


Blog :: YouTube Channel :: Connect on Linkedin


Proud to be a Super User!


View solution in original post

6 REPLIES 6
PhilipTreacy
Super User
Super User

@Julier 

 

Download this example PBIX file 

 

So what you are trying to do is only show the columns of data selected in the slicer?

 

You can use a Field Parameter for this.

 

From the Modelling menu -> New Parameter -> Fields and add the Fields (columns)

 

PhilipTreacy_0-1762670854640.png

 

make sure the check box 'Add slicer to this page' is checked and click Create

 

Create a table and add the parameter you just created, use the slicer to display the columns you want

 

PhilipTreacy_1-1762670929105.png

 

 

Regards

 

Phil



Did I answer your question? Then please mark my post as the solution.
If I helped you, click on the Thumbs Up to give Kudos.


Blog :: YouTube Channel :: Connect on Linkedin


Proud to be a Super User!


Worked like a dream Thank you !

ralf_anton
Helper II
Helper II

...ich denke, so herum wäre es Dir vielleicht lieber:

ralf_anton_0-1762597587805.png

 

Der M-Code hierfür:

let
Quelle = Excel.CurrentWorkbook(){[Name="Tabelle1"]}[Content],
OrgTopics = Table.ColumnNames(Quelle),
TopicDown = Table.DemoteHeaders(Quelle),
NewTopics = Table.ColumnNames(TopicDown),
NewNames = List.Zip({NewTopics,OrgTopics}),
RenameColumns = Table.RenameColumns(TopicDown,NewNames)
in
RenameColumns

 

Oder lieber so?

ralf_anton_0-1762600574701.png

...dann diesen M-Code:

let
Quelle = Excel.CurrentWorkbook(){[Name="Tabelle1"]}[Content],
#"Tiefer gestufte Header" = Table.DemoteHeaders(Quelle),
#"Transponierte Tabelle" = Table.Transpose(#"Tiefer gestufte Header"),
#"Sortierte Zeilen" = Table.Sort(#"Transponierte Tabelle",{{"Column2", Order.Descending}}),
#"Höher gestufte Header" = Table.PromoteHeaders(#"Sortierte Zeilen", [PromoteAllScalars=true]),
#"Umbenannte Spalten" = Table.RenameColumns(#"Höher gestufte Header",{{"Monat", "Attribut"}})
in
#"Umbenannte Spalten"

 

Jai-Rathinavel
Super User
Super User

@Julier  Please provide us with a sample file so that I can make some changes and send it over via this thread. 
You can upload the sample file to a dropbox and share the link over here.

Thanks,
Jai




Did I answer your question? Mark my post as a solution!

Proud to be a Super User!





Hi, sorry, I dont have drop box

ralf_anton
Helper II
Helper II

Hallo Julier,

 

hattest Du Dir das so vorgestellt?

 

ralf_anton_0-1762592436714.png

Vor dem Transponieren müssen die Überschriften noch heruntergesetzt werden.

Der M-Code dazu wäre dieser:

let
Quelle = Excel.CurrentWorkbook(){[Name="Tabelle1"]}[Content],
#"Tiefer gestufte Header" = Table.DemoteHeaders(Quelle),
#"Transponierte Tabelle" = Table.Transpose(#"Tiefer gestufte Header")
in
#"Transponierte Tabelle"

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

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.

Top Solution Authors