Forum Discussion

Dimitris_Kats's avatar
2 years ago

Dynamic measure name

Spoiler
 

Hello dear members. 

I need your help.

I have created the following measure:

Calculate(sum('table'[value]), selectedvalue( 'Version'[version]= 'table'[version]))

This measure is dynamin and calculates different scenarios based on user's  slicer selection. So if the selection is Actual the measure returns the actual value. If the selection is forecast it returns the forecast value. It works perfectly. 

I have used that measure and 2 other similar to this in a matrix. 

The problem is that the column name doesn't change based on the selection but it is stable and based on the measure name.

How can I dynamically change the column headers??

 

 

Thank you very much 

6 Replies

  • Alex87's avatar
    Alex87
    Solution Sage

    I do not understand what it the problem you want to solve. What column name? used where? can you provide more examples, ideally print screens of what you have and what are your expectations? thanks

    • Dimitris_Kats's avatar
      Dimitris_Kats
      Helper V

      Hi. Thank you very much for your reply.

      As I mentioned I have used the following measure in matrix

      Selected Version 1= Calculate(sum('table'[value]), selectedvalue( 'Version1'[version1]= 'table'[version]))

      In the matrix the column name displayed is the Selected Version 1

      I want that name to change dynamically based on the slicer selection. So if the user has selected from the slicers "Actual" then I want as column name "Actual" 

      I hope this makes sense now πŸ˜ƒ 

      • Alex87's avatar
        Alex87
        Solution Sage

        Thank you! It is clear now!  πŸ™‚

        From what I know, as of today, there is no possibility to change the name of the column created in the matrix. The hack I am usually doing is that I replace the name of the measure in the visual with an empty character (instead of Selected Version 1) (Empty Characters, Whitespaces & Blank Unicode Characters) and I overlay on the matrix an empty button where I control through fx the text to be displayed. (do not forget to activate maintain layer order on).

        Does it answer your query?

    • Dimitris_Kats's avatar
      Dimitris_Kats
      Helper V

      Hi. Thank you very much but I a have already dried field parameters. This was my first approach but I have to compare the 3 selected version between them and there are 13x13x13 combinations. I can't support it. 😞

       

      Thank you very much again for your support