Microsoft Fabric Community Conference 2025, March 31 - April 2, Las Vegas, Nevada. Use code FABINSIDER for a $400 discount.
Register nowThe Power BI DataViz World Championships are on! With four chances to enter, you could win a spot in the LIVE Grand Finale in Las Vegas. Show off your skills.
I have a text field in a table that I’m displaying the count for. The column name is Details, and the data in this column is either Stationary or Mobile. I have a slicer for the same field to show the count of the two results (stationary vs mobile).
Stationary
Mobile
Stationary
Stationary
Mobile
Count: 3 when stationary is selected in slicer
Count: 2 when mobile is selected in slicer
How do I dynamically change the column header in my table instead of Details to be Count of Stationary or Count of Mobile?
Is there a way to do this without creating separate measures to count each stationary and mobile values?
Hi @Soc3
Yes, you can dynamically change the column header in Power BI without creating separate measures for counting Stationary and Mobile. You can achieve this using a Measure and a Field Parameter.
Steps:
This measure will return "Count of Stationary" when "Stationary" is selected in the slicer and "Count of Mobile" when "Mobile" is selected.
2. Create a Measure for Count:
3. Add the Measures to Your Table Visual:
Use DynamicColumnHeader as the column header.
Use CountSelected as the column values.
Since DynamicColumnHeader changes based on the slicer selection, the table will update dynamically.
When Mobile is selected:
When Stationary is selected:
Best regards,
Ray Minds
http://www.rayminds.com
https://www.linkedin.com/company/rayminds/
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi @Ray_Minds ,
Thanks for your reply. I was hoping to accomplish this in a table instead of a matrix. Do you know how to implement in a table specifically where I can't differentiate between a column and a value?
Hi @Soc3
You can use matrix instead of table and this is how it works as a default :
The pbix is attached
If this post helps, then please consider Accepting it as the solution to help the other members find it more quickly
Hi @Ritaf1983 ,
Thanks for your reply.
I have multiple values to include in the matrix and when I add those values, the column header gets bumped up a level.
I've changed the terms, Detail=Advanced Booking Status and Stationary/Mobile are Advanced Purchase and Not in Advance. How do I associate the dynamic column header with the Count value?
Hi again
Please provide sample data that covers your issue or question completely, in a usable format (not as a screenshot).
https://community.powerbi.com/t5/Community-Blog/How-to-provide-sample-data-in-the-Power-BI-Forum/ba-...
Please show the expected outcome based on the sample data you provided.
https://community.powerbi.com/t5/Desktop/How-to-Get-Your-Question-Answered-Quickly/m-p/1447523