Ravindra BagaleCourses & study guides

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

  1. Modeling › New parameter › Numeric range.
  2. Name Delivery Fee Change %; Data type Decimal number; Minimum -0.5; Maximum 0.5; Increment 0.05; Default 0; keep Add slicer to this page ticked › Create.
  3. 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.
  4. 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

A common what-if mistake is 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. Don't make this mistake!