How To Calculate Percentage Measure In Power Bi

To calculate the percentage measure in Power BI, you can use the DAX formula language. Here’s a step-by-step guide with examples:

  1. Create a new measure by going to the “Modeling” tab and clicking on “New Measure”.
  2. Give your measure a name, such as “Percentage”.
  3. Write the DAX formula for the percentage calculation. For example, if you want to calculate the percentage of total sales for each product category, you can use the following formula:
<Measure Name> = SUM([Sales]) / CALCULATE(SUM([Sales]), ALL('ProductTable'))

In this formula, “Measure Name” should be replaced with the name you gave to the measure. “Sales” is the column containing the values you want to calculate the percentage for, and ‘ProductTable’ is the table containing the related data.

Here’s a breakdown of the formula:

  • SUM([Sales]) calculates the sum of the sales values for each row.
  • CALCULATE(SUM([Sales]), ALL('ProductTable')) calculates the sum of the sales values for all rows in the ‘ProductTable’ table.
  • Dividing the first result by the second result gives you the percentage value.

Once you’ve created the measure, you can use it in visualizations to see the percentage values. For example, you can create a stacked column chart and add the “Percentage” measure to the Values field to display the percentages for each product category.

Hope this explanation helps! Feel free to ask if you have any further questions.

Read more

Leave a comment