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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

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
August Power BI Update Carousel

Power BI Monthly Update - August 2025

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

August 2025 community update carousel

Fabric Community Update - August 2025

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

Top Solution Authors