Forum Discussion

Bobv013's avatar
Bobv013
New Member
1 year ago
Solved

Matrix: change measure name based on parameter selection.

Hi all,

 

I've created a matrix table which includes a measure and a parameter connected to it. 

However whenever a certain parameter is selected I want the measure to not say 'geselecteerde parameter' (selected parameter in english) but the actual name of the selected parameter. The parameter is selected through a slicer. I can't figure out how to do this. 

 

Below the matrix table: 


measure:


Parameter:

In short whichever parameter is selected in the slicer, that name should be the name in the matrix. 

Is there a way to make this happen?

Thanks in advance for any help.

 

  • Hi Bobv013 ,

    Thank you for reaching out to the Microsoft Fabric Community forum.

     

    1. Create a dynamic label measure

    Selected Parameter Label =
    VAR SelectedParam = SELECTEDVALUE('Selectie Parameter'[Selectie Parameter])
    RETURN
    SWITCH(
    SelectedParam,
    "Bruto_geboekte_premie_os", "Bruto geboekte premie os",
    "Bruto_verdiende_premie", "Bruto verdiende premie",
    "Netto_geboekte_premie_os", "Netto geboekte premie os",
    "Netto_verdiende_premie", "Netto verdiende premie",
    "Geselecteerde Parameter"
    )

    2. Replace "Geselecteerde Parameter" with this measure Geselecteerde Parameter

    To replace that label dynamically, In your matrix visual, remove the existing static row name. Add a new calculated measure placeholder row.

    Dynamic Value Measure =
    VAR SelectedParam = SELECTEDVALUE('Selectie Parameter'[Selectie Parameter velden])
    RETURN
    CALCULATE(SELECTEDPARAMETERMEASURE)

    Note: Replace SELECTEDPARAMETERMEASURE with your measure switch depending on the parameter selected. Use the Selected Parameter Label as a row value instead of hardcoding “Geselecteerde Parameter”.

     

    If this information is helpful, please “Accept it as a solution” and give a "kudos" to assist other community members in resolving similar issues more efficiently.
    Thank you.

5 Replies

  • Hi Bobv013 ,

     

    What you’re asking for—dynamically changing the measure name in the matrix based on the selected parameter—is common challenge in Power BI. By default, Power BI doesn’t allow dynamic renaming of measure titles in visuals. However, there are some workarounds you can try to achieve similar effect:

    Option 1: Use Field Parameters (Dynamic Titles in Matrix Columns)

    • With field parameters, the column/measure name shown in the matrix will be the name of the field in your parameter table.
    • Make sure your parameter table (created with the Field Parameter feature) has the display names you want to see.
    • When you select parameter in the slicer, the corresponding display name will be shown in the matrix.

    Option 2: Dynamic Titles Above the Matrix

    • While you can’t change the measure name within the matrix, you can use dynamic card or text box above the matrix to display the selected parameter.
    • Create measure like this:
      dax
       
      Selected Parameter Name = SELECTEDVALUE('ParameterTable'[ParameterName])
    • Add Card visual to your report and display this measure. Position it above or near the matrix for context.

    Option 3: Unpivot Your Data and Use Categories

    • If your table structure allows, you could unpivot your data so that all possible measures are values in single column, then use the parameter as category in the matrix. This way, the row/column headers will reflect the selected parameter.

    Important Note:
    Currently, Power BI does not support fully dynamic column/measure names inside visuals based on slicers or selections. The above options help you get as close as possible to your goal.

    References:

    If you need sample DAX code or step-by-step on any of these workarounds, let me know which option you’d like to try.

    If this helps, please give kudos and mark this as solution to help others in the community.

    Thank you!
    translation and formatting supported by AI

  • v-dineshya's avatar
    v-dineshya
    Community Support

    Hi Bobv013 ,

    Thank you for reaching out to the Microsoft Fabric Community forum.

     

    1. Create a dynamic label measure

    Selected Parameter Label =
    VAR SelectedParam = SELECTEDVALUE('Selectie Parameter'[Selectie Parameter])
    RETURN
    SWITCH(
    SelectedParam,
    "Bruto_geboekte_premie_os", "Bruto geboekte premie os",
    "Bruto_verdiende_premie", "Bruto verdiende premie",
    "Netto_geboekte_premie_os", "Netto geboekte premie os",
    "Netto_verdiende_premie", "Netto verdiende premie",
    "Geselecteerde Parameter"
    )

    2. Replace "Geselecteerde Parameter" with this measure Geselecteerde Parameter

    To replace that label dynamically, In your matrix visual, remove the existing static row name. Add a new calculated measure placeholder row.

    Dynamic Value Measure =
    VAR SelectedParam = SELECTEDVALUE('Selectie Parameter'[Selectie Parameter velden])
    RETURN
    CALCULATE(SELECTEDPARAMETERMEASURE)

    Note: Replace SELECTEDPARAMETERMEASURE with your measure switch depending on the parameter selected. Use the Selected Parameter Label as a row value instead of hardcoding “Geselecteerde Parameter”.

     

    If this information is helpful, please “Accept it as a solution” and give a "kudos" to assist other community members in resolving similar issues more efficiently.
    Thank you.

    • v-dineshya's avatar
      v-dineshya
      Community Support

      Hi Bobv013 ,

      We haven’t heard from you on the last response and was just checking back to see if you have a resolution yet.do click Accept Answer and Yes for was this answer helpful. And, if you have any further query do let us know.

       

      Thank you.

      • v-dineshya's avatar
        v-dineshya
        Community Support

        Hi @Bobv013 ,

        We haven’t heard from you on the last response and was just checking back to see if you have a resolution yet.do click Accept Answer and Yes for was this answer helpful. And, if you have any further query do let us know.

         

        Thank you.