Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
6 years ago

Dynamically Reference a Measure within another Measure

Does anyone know if it is possible to reference a measure dynamically within another measure? As an example, you want to bring back a measure if it matches the formatted value of a slicer. For example:

 

MasterTest =
VAR SelMeasure = SELECTEDVALUE('Measure Select'[Measure Select])
RETURN
"["&SelMeasure&"]"
 
The above obviously does not work, but I wonder if there is an equivilent of the INDIRECT() excel function?
 
I know I can do this manually, listing every measure in a SWITCH or IF function, but I have found that these functions run very slowly, to a point that would be unacceptable to the user (each measure normally takes 3 seconds to run, but putting them in a SWITCH increases it to 80 seconds) so wanted to try and calculate without a SWITCH/IF function

7 Replies