Forum Discussion
Dynamically Reference a Measure within another Measure
Thanks for the reply Greg. I may be that i'm not smart enough to understand your reply, but I can't see how i can make that dynamically reference multiple measures?
The VAR would still be static and referencing a single measure wouldnt it? I want the user to be able to choose multiple measures. The measures will then sit in the columns of a matrix.
I'm essentially trying to achieve the solution to this post:
But without Switch/IF, given the slowdown they create.
Thanks for your help again!
OK, that definitely clarifies things. You need a disconnected table I believe. In general, to use a measure in that way, you need to use the Disconnected Table Trick as this article demonstrates: https://community.powerbi.com/t5/Community-Blog/Solving-Attendance-with-the-Disconnected-Table-Trick/ba-p/279563
Also, see this: https://community.powerbi.com/t5/Quick-Measures-Gallery/The-New-Hotness-Custom-Matrix-Hierarchy/m-p/963588#M428
- Anonymous6 years agoNot applicable
Thanks again Greg. I think this is essentially what i've already done, but in those links you sent over, you still need to do an IF/SWITCH statement in the end to ultimately tie the measures together. I was looking at a way around this, and thought if it could dynamically reference a measure based on text, then i could skip using SWITCH altogether
- mahoneypat6 years agoMicrosoft Employee
I don't think what you are describing is possible in DAX. For example, if you could have a table of labels and DAX expressions as text, you could use the label column in your slicer and the "measure" would execute the DAX expression for that row. That doesn't exist as far as I know.
Regards,
Pat
- justinh3 years agoAdvocate IV
It would be nice to be able to reference measures within another measure using dynamic text strings.