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
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!
Ravindra Bagale's Tip – मराठी
What-if मधली एक common चूक म्हणजे तयार झालेल्या Value measure ऐवजी parameter column थेट formula मध्ये वापरणं, त्याने slicer selection ignore होतं. Power BI बनवतो तो [Discount % Value] measure वापरा, आणि योग्य default value set करा. ही चूक करू नका!
Ravindra Bagale's Tip – हिंदी
What-if की एक common गलती है बने हुए Value measure की जगह parameter column को सीधे formula में इस्तेमाल करना, जिससे slicer selection ignore हो जाता है. Power BI जो [Discount % Value] measure बनाता है वही इस्तेमाल करो, और सही default value set करो. यह गलती मत करना!