Ravindra BagaleCourses & study guides मराठी Track your progress

21. Dynamic Charts: Field Parameters, What-if and Dynamic Top N

21.4 What-if Parameters (Numeric Range)

Start with a problem

Rani asks: What would sales be if we gave a 10% discount? She wants to try different percentages herself.

Explain simply

A what-if parameter creates a number series (table + slicer) and a measure that returns the selected value. Use that value in other measures.

Show the data

Discount % Sales after discount (₹)
0% 2,100
10% 1,890
20% 1,680

About this data: This table uses columns: Discount %, Sales after discount (₹). This table uses columns: Slider, Card. This table uses columns: Wrong result, Reason, Correction. Values shown are the lesson examples already on this page (not a new dataset).

Fictional sample data. Practice file: visuals_orders_apr_may_2026.csv (source: src/practice/).

Demonstrate

  1. Modeling › New parameter › Numeric range.
  2. Name Discount %, Data type Decimal, Min 0, Max 0.3, Increment 0.05, Default 0 › tick Add slicer.
  3. Create Sales After Discount = [Total Sales] * (1 - [Discount % Value]).
  4. Card with the new measure; move the slicer to 0.10.

Show the result

Your result should look like this (fictional sample):

Slider Card
0.00 ₹2,100
0.10 ₹1,890
0.20 ₹1,680

Explain what happened

The parameter table holds 0, 0.05 … 0.3; Discount % Value uses SELECTEDVALUE to read the slider.

Explore further

  • Format the parameter column as %.

Detailed reference for this lesson:

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!

Fix common mistakes

Wrong result Reason Correction
Result unchanged Measure uses a hard-coded number Reference [Discount % Value]
Slider shows 10 instead of 0.1 Range typed as 0–30 Use 0–0.3 or divide by 100
Default blank No default Set Default and the fallback in SELECTEDVALUE

Practise independently

Practice task

What is Pune's sales after a 20% discount?

Hints
  • Pune 850.
Solution

850 × 0.8 = ₹680.

Think like a professional

What-if parameters support planning conversations. Label clearly that results are scenarios, not forecasts.

Ravi Sir's Cards for this lesson

मराठी cards