This article will briefly talk about integrating scenarios into our models. We can do that by using the Power BI What If Parameter feature. We can add this parameter to our reports as slicers or reference them on DAX expressions.
Integrating a What If Parameter into our reports enables us to create scenarios or predictive type analysis inside our models.
Creating A Power BI What If Parameter
We can use the What If Parameter feature by clicking the New Parameter option within our Modeling ribbon.
For this example, we’ll create a parameter called Pricing Scenarios, and with Decimal number as its Data type. We can also set values for the Minimum (-0.05), Maximum (.20), and Increment (0.01) fields.
Lastly, we can automatically add this as a slicer by ticking the “Add slicer to this page” checkbox. Then click the OK button.
As a result, we’ll have this slicer on our page.
To view the data of our Power BI what if parameter, just click the Data view on the left menu.
After that, we need to select the parameter that we want to view by clicking on them under the Fields section. For this example, let’s view the Pricing Scenarios.
We’ll now see that it gives us a row with all the different options we can use to run a scenario or an analysis. In fact, this data or table is what we usually consider as a supporting table for our model.
Setting Up A Power BI What If Parameter
Let’s now discuss how we can set up a what-if parameter or a supporting table on our model. First, let’s go to the Relationship view.
Then on our model, we suggest positioning it at the left side.
For this example, we also have another supporting table named Purchase Frequency. We can just position the Pricing Scenarios table beside it.
We can now integrate a new logic inside this table. We can also integrate the values in this table into our calculations. For this sample model, we can integrate our Pricing Scenarios table into the Sales table because it has a column called Unit Price.
As you can see, our Pricing Scenarios table and the Sales table don’t have a direct relationship. Hence, the Pricing Scenarios table only serves as a supporting table for our model.
***** Related Links *****
Dynamic Segmentation With Dynamic Parameters
Changing File Location Using A Query Parameter In Power BI
M Function For Date Table – How To Add A Parameter In The Query Editor
Conclusion
To sum up, we had a brief overview on how we can integrate Power BI what if parameters for creating scenarios and analysis. We’re also able to create a sample supporting table to reinforce the analysis and visualizations that we want to run on our model.
You can learn more about this by checking out our course on Data Transformations and Modeling. We included that in the list of relevant links below.
All the best,
Sam