Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
6 years ago

Dynamic Column Name based on Slicer

Hi

I have a column with values but it can be filtered based on scenarios - budget, forecast 1, forecast 2. but the column header is only called "Value" not the scenario name. I have a slicer with the dropdown to choose each scenario which filters the sum, but the column header stays the same as "Value". Is there a way for the column name to change based on the slicer scenario chosen?

 

 

Maybe I'm missing a trick. Is there a measure that dynamicallly changes its name based on the field selected?

 

Thanks anyone who can help

4 Replies

  • DataZoe's avatar
    DataZoe
    Microsoft Employee

    Anonymous I don't think there is a way to do it directly on the column name, but you could get it to look like it was changing. 

    1. Create the measure for the title, such as Col Title = coalesce(selectedvalue(ScenarioTable[ScenarioColumn]),"Value")

    2. Create a card with white background with this measure value. format it so that it's similar to what the column header is, then overlay it on top so it looks like it's the column title.

    3. Adjust your table to whatever width you like and then turn of the auto column resizing. 

     

    If you need it left aligned you can use the multi-card or a table and format it a bit to just show the value.

  • v-lionel-msft's avatar
    v-lionel-msft
    Community Support

    Hi Anonymous ,

     

    Try to add the [Scenario] column to the column label of the matrix and add the measure to the value label of the matrix and enable the 'single selection' option of the slicer.

     

    Best regards,
    Lionel Chen

    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

    • v-lionel-msft's avatar
      v-lionel-msft
      Community Support

      Hi Anonymous ,

       

      Has your problem been solved?

       

      Best regards,
      Lionel Chen

      If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.