Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.
Register now!Calling all Data Engineers! Fabric Data Engineer (Exam DP-700) live sessions are back! Starting October 16th. Sign up.
I created a what-if parameter called 'Default Target'[Default Target] that ranges from 0.8 to 0.99 in 0.01 increments. The what if parameter also built a measure for me called [Default Target Value] which is meant to return the selectedvalue of the parameter, or its default value:
Default Target Value = SELECTEDVALUE('Default Target'[Default Target], 0.94)
I want to prescribe certain [Default Targets] to load into a table, so I built them to use TREATAS to filter the table:
86_perc = CALCULATE( [MyFancyMeasure], TREATAS({{0.86}},'Default Target'[Default Target]) )
but this didn't give me the expected result (I was expecting it to use 86% as default target, not 94%).
Instead, it returns all rows based on the <alternateResult> of the selectedvalue measure:
|
Why is [CAR_86] not aligning with the actual selectedvalue of the what-if parameter slicer, and also not aligning to the filtered value from the TREATAS function? How can I effectively pass a constant to [MyFancyMeasure] so I don't have to rewrite the entire measure for each constant I want to present?
Edit: I also tried to filter the default target table in the calculate like this but it does the same thing:
CAR_86 = CALCULATE( [Default Target Value], FILTER(ALL('Default Target'),[Default Target]=0.86) )
Solved! Go to Solution.
@amitchandak Thanks for responding.
In this case I actually found the solution. The problem has to do with the level of precision in the numbers returned from the GENERATESERIES function which produces the What-If inputs. 0.86 wasn't actually present in the column:
TREATAS( {0.86} , 'Default Target'[Default Target] )
doesn't work, however:
TREATAS({0.8600000000000002}, 'Default Target'[Default Target] )
Default Target = GENERATESERIES(CURRENCY(0.6), 1.0, CURRENCY(0.001))
@cmeu , The measure where you do need .94 as default use this ?
Take it a var and pass it.
SELECTEDVALUE('Default Target'[Default Target], 0.86)
If you want to remove a selected value, then why do you need whatif, you can filter on static value.
@amitchandak Thanks for responding.
In this case I actually found the solution. The problem has to do with the level of precision in the numbers returned from the GENERATESERIES function which produces the What-If inputs. 0.86 wasn't actually present in the column:
TREATAS( {0.86} , 'Default Target'[Default Target] )
doesn't work, however:
TREATAS({0.8600000000000002}, 'Default Target'[Default Target] )
Default Target = GENERATESERIES(CURRENCY(0.6), 1.0, CURRENCY(0.001))
Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!
Check out the October 2025 Power BI update to learn about new features.