What if Parameter in Power BI

In this Power BI article, we will learn what is What if Parameter in Power BI is and how to add the What if Parameter to the Power BI report.

What if Parameter Power BI

  • We can easily analyze data using the what-if parameter in Power Bi. It displays dynamically the value based on the condition applied for different scenarios.
  • For example, we can easily check what if sales increased by 10% using the what-if parameter in Power Bi.

Add What if Parameter in Power BI

Let us see how we can add or create a What-if parameter in the Power Bi report.

In this example, we are going to use the sales table data, to add the what-if parameter slicer visuals in Power Bi.

  • Open the Power Bi desktop, and load the data into it using the get data option. Once the data has been loaded, select the clustered column chart and drag and drop the customer location and sales field values in it as below:
Add What if Parameter in Power BI
Add What if Parameter in Power BI
  • Now Click the Modeling tab in the top ribbon and select the What IF parameter as highlighted below:
Add What if Parameter in the Power BI
Add What if Parameter in the Power BI
  • A What if parameter pop window appears, In the Name section we can enter the parameter name, here the parameter name is Sales%.
  • In the Data type, we can select the data type as a whole number, decimal number, and fixed decimal number.
  • We can also set Minimum value, Maximum value, Increment, and Default value, and to save the What-if parameter clicks on the ok button below:
Add What if Parameter in Power BI example
Add What if Parameter in Power BI example
  • Under the Fields pane, we can see that the Parameter has been created as a New Table
  • Once the parameter has been created. It automatically creates two measure values for the generated series and for the selected value
See also  Power BI Error: Contact your admin to enable embed code creation

For generated series:

Sales % = GENERATESERIES(1, 2, 0.01)

For Selected Value:

Sales % Value = SELECTEDVALUE('Sales %'[Sales %], 1)
create a What if Parameter in Power BI
create a What if Parameter in Power BI
  • Now we can apply the parameter to calculate the percentage of the total sales, create a new measure and apply the below-mentioned formula:
Total Sales % = Sales_Table[totalsales] * 'Sales %'[Sales % Value] 

Where,

  1. Total Sales % = New measure name
  2. Sales_Table = Table Name
  3. Sales %'[Sales % Value] = Parameter Value
  • Now simply drag and drop the created measure value in the clustered column chart. The screenshot below displays the sales and total sales value as the same.
create a What if Parameter in Power BI example
create a What if Parameter in Power BI example

When we change or slide the Parameter slicer value, the clustered column chart displays the total sales value according to the selection.

Example to Add What if Parameter in Power BI
Example to Add What if Parameter in Power BI

This is how we can add or create a What-if parameter in the Power Bi report.

Also, read Power BI what if Parameter Percentage

Power BI what if the parameter in a calculated column

  • No, the Calculated column doesn’t support the What if Parameter in Power Bi. we cannot filter the values dynamically in the calculated column using the What if Parameter.
  • Because Power Bi What if parameter supports and filters the values dynamically only on the Power Bi DAX measures. So we can replace the Calculated column with the Power Bi measures and use the What if Parameter.

What if Parameter Power Bi Text

  • No, it is not possible to input the string data type into the Power Bi text using the What if Parameter.
  • In the Power BI What-if parameter, we can select the data type as a whole number, decimal number, and fixed decimal number. and not the string data type to input the string value.
See also  How to Subtract in Power BI Using DAX?

This Power BI article demonstrated what is What if Parameter is and how to add the What if Parameter to the Power BI report.

You may like the following Power BI tutorials:

>