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

Compete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.

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
July 2025 community update carousel

Fabric Community Update - July 2025

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

July PBI25 Carousel

Power BI Monthly Update - July 2025

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