Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started
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
Check out the September 2024 Power BI update to learn about new features.
Learn from experts, get hands-on experience, and win awesome prizes.
User | Count |
---|---|
113 | |
94 | |
88 | |
35 | |
32 |
User | Count |
---|---|
153 | |
101 | |
82 | |
63 | |
52 |