Power BI — What-if parameter

Michal Molka
2 min readApr 30, 2021

In many cases, when you share a report with your users. You want to allow them to enter parameters which influence on measures or indicators.

The perfect solution is a What-if parameter.

Let’s assume that we want to give a user a possibility to manipulate a value of following measure.

Quantity = COUNTROWS(Posts)

User wants to get the measure value after he had added an additional specified percentage value of this measure. An example is worth more than thousand words, so let’s go to a real case.

Firstly, you need to create a parameter and its properties.

Power BI created a table with a calculated column and a measure.

Percentage Change = GENERATESERIES(0, 1, 0.01)
Percentage Change Value = SELECTEDVALUE('Percentage Change'[Percentage Change], 0)

The column includes all values between 0 and 1 with 0.01 step. It provides values to a slicer.

The measure stores a selected value from the slicer above.

And this is a place where the magic happens.

Quantity = COUNTROWS(Posts) * (1+ 'Percentage Change'[Percentage Change Value])

The measure result is calculated taking into an account the Percentage Change Value parameter.

--

--