Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Shape the future of the Fabric Community! Your insights matter. That’s why we created a quick survey to learn about your experience finding answers to technical questions. Take survey.

Reply
jhayes0128
Frequent Visitor

Access Field Parameter values in DAX

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:

jhayes0128_0-1695315327392.png

The values inside of each column:

jhayes0128_1-1695315351919.png

 

1 REPLY 1
AmiraBedh
Most Valuable Professional
Most Valuable Professional

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

Proud to be a Power BI Super User !

Microsoft Community : https://docs.microsoft.com/en-us/users/AmiraBedhiafi
Linkedin : https://www.linkedin.com/in/amira-bedhiafi/
StackOverflow : https://stackoverflow.com/users/9517769/amira-bedhiafi
C-Sharp Corner : https://www.c-sharpcorner.com/members/amira-bedhiafi
Power BI Community :https://community.powerbi.com/t5/user/viewprofilepage/user-id/332696

Helpful resources

Announcements
November Carousel

Fabric Community Update - November 2024

Find out what's new and trending in the Fabric Community.

Dec Fabric Community Survey

We want your feedback!

Your insights matter. That’s why we created a quick survey to learn about your experience finding answers to technical questions.