In this Power BI article, how to add the What if Parameter Percentage to a Power BI report.
What if Parameter Percentage in Power BI
Let us see how to add the what-if parameter percentage in the power bi report.
Here in this article, we use sales table data and calculate the percentage of the discount value based on the product column.
- Loadtable data into Power BI desktop -> select a get data option -> and choose the clustered column and drag and drop the Product Name and Discount field values in it as below:
- Now select a Modeling tab in the top ribbon and select the What IF parameter as highlighted below:
- A What if parameter pop window appears, Enter the parameter name in the name section.
- In the Data type section, 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:
- 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.
For generated series:
DiscountValue = GENERATESERIES(1, 2, 0.01)
For Selected Value:
DiscountValue Value = SELECTEDVALUE('DiscountValue'[DiscountValue])
- Now we can apply the parameter to calculate the percentage of the discount column based on the product value, create a new measure and apply the below-mentioned formula:
Discount % = Sales_Table[discount value] * DiscountValue[DiscountValue Value]
- Discount % = New measure name
- Sales_Table = Table Name
- DiscountValue[DiscountValue Value] = Parameter Value
- Now simply drag and drop the created measure value in the clustered column chart. The screenshot below displays the discount and discount percent value based on the product as the same.
- When we change or slide the Parameter slicer value, the clustered column chart displays the discount percentage value according to the selection.
This is how to display the What-if parameter percentage value in the Power Bi report.
This Power BI article demonstrated how to display the What-if parameter percentage value in the Power Bi report.
You may also like the following power bi tutorials:
- What if Parameter in Power BI
- What if parameter Power BI Date
- What if Parameter in Power BI filter
- How to create a relationship in power bi without unique values
- Power BI Convert Number to Text
I am Bijay a Microsoft MVP (8 times – My MVP Profile) in SharePoint and have more than 15 years of expertise in SharePoint Online Office 365, SharePoint subscription edition, and SharePoint 2019/2016/2013. Currently working in my own venture TSInfo Technologies a SharePoint development, consulting, and training company. I also run the popular SharePoint website EnjoySharePoint.com