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

Grow your Fabric skills and prepare for the DP-600 certification exam by completing the latest Microsoft Fabric challenge.

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
Resident Rockstar
Resident Rockstar

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
Europe Fabric Conference

Europe’s largest Microsoft Fabric Community Conference

Join the community in Stockholm for expert Microsoft Fabric learning including a very exciting keynote from Arun Ulag, Corporate Vice President, Azure Data.

RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

Ask questions in Eventhouse and KQL, Eventstream, and Reflex.