21. Dynamic Charts: Field Parameters, What-if and Dynamic Top N
21.4 What-if Parameters (Numeric Range)
Scenario: "What happens to delivery-fee revenue if we change the fee by −50% to +50%?"
Steps in Power BI
- Modeling › New parameter › Numeric range.
- Name
Delivery Fee Change %; Data type Decimal number; Minimum-0.5; Maximum0.5; Increment0.05; Default0; keep Add slicer to this page ticked › Create. - Power BI creates a table with
GENERATESERIES(-0.5, 0.5, 0.05), a measure[Delivery Fee Change % Value]and a slider slicer. Format the column as Percentage. - Create the scenario measure below and show it next to the current revenue in cards or a clustered column chart.
Delivery Fee Change % Value = SELECTEDVALUE('Delivery Fee Change %'[Delivery Fee Change %], 0)
Projected Delivery Fee Revenue =
[Delivery Fee Revenue] * (1 + [Delivery Fee Change % Value])
(This simple scenario assumes the number of orders does not change. In reality, customers may react to fee changes.)
More what-if ideas: a Target Delivery Minutes parameter (8–20) used in % Orders Under Target; a Discount % parameter to test margin impact.
% Orders Under Target =
VAR target = [Target Delivery Minutes Value]
RETURN DIVIDE(
CALCULATE(DISTINCTCOUNT(Orders[Order ID]), Orders[Delivery Time Mins] <= target),
CALCULATE(DISTINCTCOUNT(Orders[Order ID]), Orders[Order Status] = "Delivered"))
Ravindra Bagale's Tip
What-if madhli ek common chuk mhanje using the parameter column directly in a formula instead of the generated Value measure, which ignores the slicer selection. Use the [Discount % Value] measure that Power BI creates, and set a sensible default value. Chuk karu naka!