The ultimate Fabric, Power BI, SQL, and AI community-led learning event. Save €200 with code FABCOMM.
Get registeredEnhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.
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".
Solved! Go to Solution.
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.
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.