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

Join us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. Register now.

Reply
amikm
Helper V
Helper V

dynamic matrix column header as per slicer

I have a slicer, I want to display the column header according to slicer selection in my report.

Say, I have selected A from my slicer then all the columns of table A in my matrix visual header should appear and If I select B from my Slicer, it should display all the columns of table B in my matrix visual header.

 

Note: I need to drag the formula in my column in my matrix visual

 

table A and table B have one one column say 'name" column in them and both tables are static.

5 REPLIES 5
Anonymous
Not applicable

Hi @amikm ,

 

So you have three tables? Table A and B has different products with sales and table C has all the products? If so, you could create a custom column "tablename" for each tables and use it as slicer. For example:

table a
product sales tablename
product1 10 a
product2 20 a
product3 30 a

table b
product sales tablename
product4 40 b
product5 50 b
product6 60 b

table c
product tablename
product1 a
product2 a
product3 a
product4 b
product5 b
product6 b

 

Best Regards,

Jay

 

Hi @Anonymous,

My question is simple, I want to use a field inside my matrix visual in the column section.

Say, for example, If the user is selecting Drink from the slicer, then all the values of the Drink table should appear in matrix column header and If user is selecting Food from slicer then all the values of Food table should appear in the matrix column header.

 

I have created one table for Drink and another table as Food separately so that I can pass the values of Food and Drink as per slicer selection to the matrix column header.

 

I am not able to change the matrix column bucket as per my slicer. 

Currently, it looks like this

row-> customername

column-> Drink [water, mocktail, milk]

value-> price

 

Hope, it clear now.

 

I want to change the column from Drink to Food dynamically as per slicer selection

row-> customername

column-> Food [Pizza, burger, Dosa]

value-> price

selimovd
Super User
Super User

Hey @amikm ,

 

as far as I know you can't change the column names dynamically.

But you can add the current slicer selection to the title of the visual with a measure.

Check the following video on how to do that:

https://youtu.be/XXv13mkjV2Y

 

If you need any help please let me know.
If I answered your question I would be happy if you could mark my post as a solution ✔️ and give it a thumbs up 👍
 
Best regards
Denis
 
amitchandak
Super User
Super User

@amikm , if you want to change the column, one way is button and bookmarks

https://radacad.com/bookmarks-and-buttons-making-power-bi-charts-even-more-interactive

 

Or you can unpivot the the columns and make the as row value and then you can filter them

 

or refer these ways

 

Dynamically change chart axis in Power BI
https://www.youtube.com/watch?v=6jeSIRpjv0M
https://datamonkeysite.com/2020/10/22/change-dimension-dynamically-using-parameter-in-powerbi/

 

 

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

Thanks @amitchandak, @selimovd I am trying to do this with DAX as I need to use Dynamic header (not title) as I need to display in my matrix visual

 

Case1, when user has Selected TopProduct from slicer

matrix visual

Custno, Sales,Product1, Product2,Product3

1,$100,$2,$3,$5

2,$400,$5,$9,$0

 

Case2, when user has Selected LowProduct from slicer

Custno, Sales,Product4, Product5,Product6,Product7

3,$10,$2,$3,$5

4,$20,$5,$9,$0

 

I have a single table where I have all the Product name, I have created two separate tables and I am trying to pass the tablehigh (colhigh) and tablelow(collow) in my matrix visual column header.

 

 

Helpful resources

Announcements
July PBI25 Carousel

Power BI Monthly Update - July 2025

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

Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 community update carousel

Fabric Community Update - June 2025

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