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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
Anonymous
Not applicable

Modify DAX for Field Parameters

Hi,

 

I have exisiting field parameter with slicer that works but I would to modify the dax so it will return values based on another field parameter slicer. However, I'm getting an error with the dax.

"The expression refers to multiple columns. Multiple columns cannot be converted to a scalar value."

I'm not sure if my approach is correct but I would appreciate any help please @TheoC  @JoaoMarcelino 

qsmith83_0-1667159639518.png

 

 

Comparative Scen3 (field param) = 
VAR Comparative_Scenario_USD =
{
    ("Budget", NAMEOF('KPI USD'[KPI MTD Budget USD]), 0),
    ("Last Year", NAMEOF('KPI USD'[KPI MTD LY USD]), 1),
    ("2019", NAMEOF('KPI USD'[KPI MTD 2019 USD]), 2),
    ("Forecast", NAMEOF('KPI USD'[KPI MTD Forecast USD]), 3)
}

VAR Comparative_Scenario_LOCAL =
{
    ("Budget", NAMEOF('KPI'[KPI MTD Budget]), 0),
    ("Last Year", NAMEOF('KPI'[KPI MTD LY]), 1),
    ("2019", NAMEOF('KPI'[KPI MTD 2019]), 2),
    ("Forecast", NAMEOF('KPI'[KPI MTD Forecast]), 3)
}

RETURN
SWITCH(
    SELECTEDVALUE(ParamCurrency[ParamCurrency]),
    "USD", Comparative_Scenario_USD,
    "LOCAL", Comparative_Scenario_LOCAL
)

 

 

 

 

 

2 REPLIES 2
amitchandak
Super User
Super User

@Anonymous , As of now field parameters can filter slicers of another field parameter. You can check and vote for an existing idea : https://ideas.powerbi.com/ideas/

Anonymous
Not applicable

@amitchandak - thanks for the feedback. That's a shame. I guess the alternative options could be using bookmarks or creating a table for the slicer selection and then creating measures using selected value.

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

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

Top Solution Authors