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
KryptoNox
New Member

Is it possible to add a filter to a field parameter selection?

I am fairly new to PowerBI and DAX, coming from a qliksense background. Loving the new field parameter preview feature, its been working great for me but I've reached a point where I can't figure out what I need.

 

I have a line chart that I had added a field parameter to as a legend to allow the user to select different selections and have it change the line chart to show different views. For one of these views I need to also filter the chart to one specific field selection.

 

My code is similar to :

 

MSV={

("Overall", NAMEOF([None Field]), 0),

("Broad LOB", NAMEOF('Table'[Field]),1),

("Industry", NAMEOF('Table'[Field]), 2)

}

 

What I want to do is:

MSV={

("Overall", NAMEOF([None Field]), 0),

("Broad LOB", NAMEOF('Table'[Field]),1),

("Industry", NAMEOF('Table'[Field]),Filter('Table'[Broad LOB]="Commercial"), 2)

}

 

I get a syntax error with this code. Not sure if field parasmeters allow for inline filters to be added or if I am just doing it wrong. Is this possible either similar to the way I am doing it or something else for when they select the Industry field parameter it filters Broad LOB to commerical lines only?

3 REPLIES 3
v-jingzhang
Community Support
Community Support

Hi @KryptoNox 

 

I found a solution without using the field parameter. First I spent time researching a solution with field parameter but failed to get one. So I turned back to the classic practice before field parameter appeared. Hope this would be helpful. The sample pbix file has been attached at bottom. 

 

First I enter a table like below.

vjingzhang_0-1673513179305.png

 

Then create measures

Broad LOB = SUM('Table'[Amount])
Industry = CALCULATE(SUM('Table'[Amount]),'Table'[Field]="AA")
Display Amount = SWITCH(SELECTEDVALUE(MSV[MSV]),
"Industry",[Industry],
[Broad LOB]
)
Measure = IF(SELECTEDVALUE(MSV[MSV])="Industry",IF(SELECTEDVALUE('Table'[Field])="AA",1,0),1)

 

Then create a line chart like below. Use the last measure as a filter on the table visual to show items when value is 1. 

vjingzhang_0-1673513474881.png

vjingzhang_1-1673513490605.png

 

Best Regards,
Community Support Team _ Jing
If this post helps, please Accept it as Solution to help other members find it.

Thanks. This likely works as a solution, but my boss really wants me to use field parameters for this task. Can you tell me what you tried initially with field parameters? I am wondering if something with an if statment on selected value(field parameter) might work, but I am just so new to DAX I'm not sure.

Hi @KryptoNox 

 

My failure trial is in page 2 of the attached file. It is the closest trial but still doesn't work. It has a line for blank in the chart. If I filter out the blank, the broad LOB option doesn't show all lines correctly. Other trials brought a lot of errors either in the formula or in the visual, I don't reproduce them in the sample file. 

 

For your original code of the field parameter, it is a DAX syntax to create a table. I'm afraid it's difficult to add a filter here to make it work. Table constructor - DAX | Microsoft Learn

MSV={
("Overall", NAMEOF([None Field]), 0),
("Broad LOB", NAMEOF('Table'[Field]),1),
("Industry", NAMEOF('Table'[Field]), 2)
}

 

BR,

Jing

Helpful resources

Announcements
November Power BI Update Carousel

Power BI Monthly Update - November 2025

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

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!

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.

Top Solution Authors