Jefferson Bauer on 28 Feb 2024 17:22:41
This concept would allow users to store meta data in a table and use it to dynamically convert the text value to a [measure] for calculating. Maybe a function called CONVERT_TO_MEASURE that takes a text value and returns an actual [measure] that can be used in dax calculations.
For example, suppose you have a table you keep in your model specific to organizing a report layout on a Matrix. On the table you store a field called UseMeasure. In that field you can specify a measure for row to use.
Dynamic Measure =
VAR VarCalcType = SELECTEDVALUE('Report Layout'[CalcType])
VAR varMeasure = CONVERT_TO_MEASURE(SELECTEDVALUE('Report Layout'[UseMeasure])) // <-- This would change the text value to a [measure]
VAR varFormat = SELECTEDVALUE('Report Layout'[Format])
VAR varSign = SELECTEDVALUE('Report Layout'[Sign])
RETURN
SWITCH(TRUE, VarCalcType = "USE_MEASURE", FORMAT(varMeasure * varSign, varFormat), BLANK())