Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
5 years ago

Measure name string to measure

Hi,

I'm writing calculated groups vs target and I'm replacing one word from measure name. 

SUBSTITUTE("[" & SELECTEDMEASURENAME() & "]", "Act", "Tgt")

Do you know if there is a function to convert string "[Measure Tgt]" to measure format without quotation marks: [Measure Tgt]?

 

Thank you for you're answers

2 Replies

  • DAX can't take a name of a measure and evaluate it using a mechanism like EVAL in other languges. In other words, it's not possible to have dynamically evaluated strings. If you want to do something similar, you have to use SWITCH.

  • Anonymous's avatar
    Anonymous
    Not applicable

    That's a pity. I wanted to do this more elegant than have 50 SWITCH rows.