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

Compete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.

Reply
svssatish
Frequent Visitor

Matrix report Header title to change based on the selection of the parameter table

pb_test.jpgI have parameter table: 

ParamTest =
DATATABLE(
    "ParameterValue", STRING,
    {
        {"Category"},
        {"Sub Category"},
        {"Hide Category/Sub category"}
    }
)
Region column : AP,EU,US
In values Column: 
  SWITCH(
            SELECTEDVALUE(ParamTest[ParameterValue]),
            "Category", SUM(Category),
            "Sub Category", SUM(Sub Category),
          SUM(Category)
        )


NewHeaderColumn =
CALCULATE(
    SWITCH(
        TRUE(),
        SELECTEDVALUE(ParamTest[ParameterValue]) = "Category", "Category",
        SELECTEDVALUE(ParamTest[ParameterValue]) = "Sub Category", "Sub Category",
        "Hide Category/Sub category"
    )
)


(NewHeaderColumn =)header column string value is not changing based on the parameter value selection but values Column (measure) is changing.


1 ACCEPTED SOLUTION
DataNinja777
Super User
Super User

Hi @svssatish ,

 

Power BI doesn't allow dynamic column headers in matrix or table visuals. Even though your measure value changes based on the selected parameter using a SWITCH function, the column header remains static because column names in visuals are determined by the measure name, not by calculated values. Your formula for NewHeaderColumn is correctly returning the selected parameter label, but you can't assign that as a dynamic header title inside the matrix visual. Power BI doesn't support using a measure to rename a column on the fly.

A workaround is to use a card visual that displays the dynamic header separately, and place it above the matrix to give the illusion of a dynamic column name. Create a measure like this:

DynamicHeaderTitle = 
SWITCH(
    SELECTEDVALUE(ParamTest[ParameterValue]),
    "Category", "Category",
    "Sub Category", "Sub Category",
    " "
)

Place this in a card visual. Then rename the measure used in the matrix visual to a generic label like Selected Metric. The card visual above it will display the selected parameter name (e.g., "Category"), and the matrix will show the values for that selection, creating the appearance of a dynamic header even though the matrix header is technically static.

 

Best regards,

View solution in original post

10 REPLIES 10
v-menakakota
Community Support
Community Support

Hi @svssatish   ,

Thanks for reaching out to the Microsoft fabric community forum. 

I wanted to check if you had the opportunity to review the information provided. Please feel free to contact us if you have any further questions. If my response has addressed your query, please accept it as a solution so that other community members can find it easily. 

Best Regards, 
Menaka.
Community Support Team 

 

Hi @svssatish ,

May I ask if you have resolved this issue? If so, please mark the helpful reply and accept it as the solution. This will be helpful for other community members who have similar problems to solve it faster. 

Best Regards, 
Menaka.
Community Support Team 

Its not resolved and powerbi does not allow this functionality and this is one of my prime requirement for a transition project.

Hi @svssatish ,

I hope this information is helpful. Please let me know if you have any further questions or if you'd like to discuss this further. If this answers your question, please Accept it as a solution and give it a 'Kudos' so others can find it easily.

Best Regards, 
Menaka.
Community Support Team  

 

 

I didn't get a solution for this issue.

danextian
Super User
Super User

Hi @svssatish 

 

Power BI does not support dynamically column names  based on slicer selections.  Calculated columns also are not aware of slicer selections. You can instead add that ParamTest[ParameterValue] to the column tile of a matrix visual together with the measure referencing it. I am unsure though what you want to show when Hide Category/Sub category is selected.





Dane Belarmino | Microsoft MVP | Proud to be a Super User!

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


"Tell me and I’ll forget; show me and I may remember; involve me and I’ll understand."
Need Power BI consultation, get in touch with me on LinkedIn or hire me on UpWork.
Learn with me on YouTube @DAXJutsu or follow my page on Facebook @DAXJutsuPBI.

Hi Danextian,
Can you help me in detailed about "ParamTest[ParameterValue] to the column tile of a matrix visual together with the measure referencing it. "

?

 

 

Hi @svssatish ,

Thank you for reaching out to us on the Microsoft Fabric Community Forum.

Please go through the below links which are similar to the same issue and help you in resolving the issue. 


Solved: Dynamically changing matrix column headers based o... - Microsoft Fabric Community
Solved: How to Dynamically Set Field Parameter Title Based... - Microsoft Fabric Community

If this post was helpful, please give us Kudos and consider marking Accept as solution to assist other members in finding it more easily.

DataNinja777
Super User
Super User

Hi @svssatish ,

 

Power BI doesn't allow dynamic column headers in matrix or table visuals. Even though your measure value changes based on the selected parameter using a SWITCH function, the column header remains static because column names in visuals are determined by the measure name, not by calculated values. Your formula for NewHeaderColumn is correctly returning the selected parameter label, but you can't assign that as a dynamic header title inside the matrix visual. Power BI doesn't support using a measure to rename a column on the fly.

A workaround is to use a card visual that displays the dynamic header separately, and place it above the matrix to give the illusion of a dynamic column name. Create a measure like this:

DynamicHeaderTitle = 
SWITCH(
    SELECTEDVALUE(ParamTest[ParameterValue]),
    "Category", "Category",
    "Sub Category", "Sub Category",
    " "
)

Place this in a card visual. Then rename the measure used in the matrix visual to a generic label like Selected Metric. The card visual above it will display the selected parameter name (e.g., "Category"), and the matrix will show the values for that selection, creating the appearance of a dynamic header even though the matrix header is technically static.

 

Best regards,

Thanks DataNinja.. Unfortunately i can't use the suggested approach as I have multiple columns with Header and Sub Header will keep change. Dynamic column functionality is needed.

Helpful resources

Announcements
August Power BI Update Carousel

Power BI Monthly Update - August 2025

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

August 2025 community update carousel

Fabric Community Update - August 2025

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

Top Solution Authors