Create a What-if Parameter in Power BI? 

In any data analysis project, whenever we analyze data, always want to find out, some what-if scenarios. For example, what if sales increased by 10% or what if we decreased item cost by 1%. 

These what-if analyses can be very helpful for any decision-making process. 

Power BI has an AI-driven feature that enables us to implement these what-if scenarios. This is known as What-If Parameters

Here , we are going to explore this functionality with examples.

Get Data

For this scenario, I consider the sales dataset and the file location available in below path.

Let’s start with the Get Data option under the Home tab. Extract data from  Excel workbook option from the quick connections.

•Select the file named US Superstore data.xlsx

•After selecting the file,

•data will be displayed in the below format

•Click on Load and save data.

Where to find What-if Parameter tab?

By default

It is having below parameters inside

What-if Parameters:

Name of the what-if parameter

Data type (Whole number (Default), Decimal number, Fixed decimal number)

Minimum

Maximum

Increment

Default: a value used for the what-if parameter when no value is selected in the slicer.

Add slicer to this page default selection

Create Discount/Markup What if Parameter

1.Create one What if parameter and provide the below information.

2.Name -> “Discount Range”, Data type → Decimal number, Minimum → 0, Maximum -> 1, Increment -> 0.01

3.click the check box for “Add slicer to this page”.

4. Click on the “OK” button and two things will be added.

i) Created “Discount/Markup” table

ii) Added one slicer in the page as Discount/Markup.

What -if parameter created, but you don’t know how you can use this in your project. 

Let us find the application of this parameter. 

1.Create one calculated measure to use this above parameter in your project.

2.Create the below measure under the “US Superstore data” table.
Updated Sales =

‘Discount/Markup'[Discount/Markup Value] * SUM(Orders[Sales])

I have taken Waterfall Chart under Visualization pane.

4. Add Order Date Hierarchy in the Category section. Keep the only Year and Month.

5. Add Category field in the Breakdown section.

6. Add Revised Sales in Values.

Choose the above fields.

Enable the data label and increase the font size and units I am displaying with None. So that the end user can see full value. from the single slicer we can Use the Discount/Markup slicer to try different values and observe the changes in the chart. 

Save this report with What If parameter analysis .pbix format.

Please share your comments if any

Leave a comment