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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now

Reply
smithmpi
Frequent Visitor

Error When Referencing Field Parameter in a Measure

I have a measure that dynamically returns a chart title based on slicer selection.

 

Now I want to add to the measure a field parameter that will determine the chart title based on the slicer selections AND the field parameter selection. However, I get an error when trying to do so. 

 

Is it even possible to implement what I'm trying to achieve? Appreciate any tips please @bhanu_gautam @lbendlin 🙂

 

Note: the field parameter is referencing measures only and for each of the measures referenced, they too are referencing other measures. Hope that makes sense.

 

 

Dynamic Chart Title = 
VAR FieldParameter = SELECTEDVALUE('Ethnicity Filter'[Ethnicity Filter])
VAR Slicer1 = SELECTEDVALUE('Gender and Ethnic Pay'[Business Unit 1])
VAR Slicer2 = SELECTEDVALUE('Gender and Ethnic Pay'[Business Unit 2])
VAR ChartTitle = 
    IF(
        ISBLANK(FieldParameter),
        "ALL ETHNICITIES",
        FieldParameter & " REPRESENTATION"
    )
RETURN
SWITCH(
    TRUE(),
    ISBLANK(Slicer1) && ISBLANK(Slicer2), "MPI - " & ChartTitle & " by TENURE",
    NOT ISBLANK(Slicer1) && ISBLANK(Slicer2), UPPER(Slicer1) & " - " & ChartTitle & " by TENURE",
    NOT ISBLANK(Slicer1) && NOT ISBLANK(Slicer2), UPPER(Slicer2) & " - " & ChartTitle & " by TENURE"
)

 

//Field Parameter
Ethnicity Filter = {
    ("European", NAMEOF('Measures - General'[European Rate]), 0),
    ("Other Ethnicity", NAMEOF('Measures - General'[Other Rate]), 1),
    ("Asian", NAMEOF('Measures - General'[Asian Rate]), 2),
    ("Māori", NAMEOF('Measures - General'[Māori Rate]), 3),
    ("Pacific Peoples", NAMEOF('Measures - General'[Pacific Rate]), 4),
    ("MELAA", NAMEOF('Measures - General'[MELAA Rate]), 5)
}

 

smithmpi_0-1722311234200.png

 

2 REPLIES 2
lbendlin
Super User
Super User

the field parameter is referencing measures only and for each of the measures referenced, they too are referencing other measures. Hope that makes sense.

During troubleshooting you will want to keep it simple.  Recommendation is to expand all measures and avoid nesting.

Anonymous
Not applicable

Hi @smithmpi,

Could you please share a pbix or some sample data that maintains the original data structure and expected results? This will help us clarify your situation and test the coding formulas.
Best regards,

Joyce

Helpful resources

Announcements
Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

Check out the October 2025 Power BI update to learn about new features.

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.