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
Brysonds
Helper III
Helper III

Apply what-if value only to row value based on slicer selection

Hello!

 

I have a measure called simulated cost based on a what-if parameter that takes "cost" + "parameter value" when a column value equals "material". This works great!

 

Simulated Cost =
SUMX(FILTER('Analysis 1','Analysis 1'[Cost Price Component]="Material"), 'Analysis 1'[Cost] + Parameter[Parameter Value])

 

My question is instead of setting a static value "Material" in the formula, can I have this be a dynamic value based on a slicer selection? I have would have a slicer for "Cost Price Component".

1 ACCEPTED SOLUTION
BKirsch12
Resolver II
Resolver II

I think I understand what you are doing, that is, you want to be able to pass in a value into where you have material.

 

 

I've done this in the past by passing in a variable. Theres a couple steps to follow.

 

Make a one column table [OptionsTable] with all the possible filter options. 

 

Then change your measure to this.

 

Simulated Cost =

 

VAR FilterValue = SELECTEDVALUE(OptionsTable[Column1])

 

RETURN


SUMX(FILTER('Analysis 1','Analysis 1'[Cost Price Component]=FilterValue), 'Analysis 1'[Cost] + Parameter[Parameter Value])

 

Column1 should be the heading you gave the column. Simply put the table as a slicer on the sheet, no need to create a relationship, as this will just let the selected value into the measure.

 

Let me know if this helps. Thanks.

 

View solution in original post

1 REPLY 1
BKirsch12
Resolver II
Resolver II

I think I understand what you are doing, that is, you want to be able to pass in a value into where you have material.

 

 

I've done this in the past by passing in a variable. Theres a couple steps to follow.

 

Make a one column table [OptionsTable] with all the possible filter options. 

 

Then change your measure to this.

 

Simulated Cost =

 

VAR FilterValue = SELECTEDVALUE(OptionsTable[Column1])

 

RETURN


SUMX(FILTER('Analysis 1','Analysis 1'[Cost Price Component]=FilterValue), 'Analysis 1'[Cost] + Parameter[Parameter Value])

 

Column1 should be the heading you gave the column. Simply put the table as a slicer on the sheet, no need to create a relationship, as this will just let the selected value into the measure.

 

Let me know if this helps. Thanks.

 

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
Top Kudoed Authors