Starting December 3, join live sessions with database experts and the Microsoft product team to learn just how easy it is to get started
Learn moreGet certified in Microsoft Fabric—for free! For a limited time, get a free DP-600 exam voucher to use by the end of 2024. Register now
I have a field parameter referencing 3 different columns. The values inside of those columns are the same. I want to write a measure that says "if GPDCN do something special". Using SELECTEDVALUE or SUMMARIZE on the parameter table just returns the name of the column (like LE_PROXY) but I need the values of that column inside of a measure. How to do this?
Field Parameter:
The values inside of each column:
With DAX, it's not straightforward to dynamically switch between different columns based on a parameter and then also evaluate the values within those columns.
But here is a workaround :
SpecialMeasure =
VAR SelectedField = SELECTEDVALUE('ParameterTable'[FieldName], "Default")
VAR Result =
SWITCH(
TRUE(),
SelectedField = "Budget", CALCULATE(SUM('Fact_Impacts'[BUDGET_PROXY]), 'Fact_Impacts'[BUDGET_PROXY] = "GPDCN"),
SelectedField = "LE", CALCULATE(SUM('Fact_Impacts'[LE_PROXY]), 'Fact_Impacts'[LE_PROXY] = "GPDCN"),
SelectedField = "YoY", CALCULATE(SUM('Fact_Impacts'[PY_PROXY]), 'Fact_Impacts'[PY_PROXY] = "GPDCN"),
BLANK()
)
RETURN
Result
Starting December 3, join live sessions with database experts and the Fabric product team to learn just how easy it is to get started.
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Early Bird pricing ends December 9th.
User | Count |
---|---|
94 | |
90 | |
84 | |
70 | |
49 |
User | Count |
---|---|
143 | |
121 | |
112 | |
59 | |
58 |