How to Calculate Percent of Total in Power BI?

Are you looking at Power BI percent of total measure? If your requirement is yes, we can achieve this with the help of some measure calculation.

In this Power BI tutorial, we will learn how to calculate percent of total in Power BI.

How to Calculate Percent of Total in Power BI

Now, we will see how to calculate the percentage of the total in Power BI measure.

Here, I have a SharePoint list (Finacial Sample) that contains below columns with various data types:

ColumnData Types
ProductSingle line of text
CountrySingle line of text
Units SoldNumber
SalesCurrency
ProfitCurrency
power bi new measure percentage

1. Open Power BI Desktop and load the data. Then, you see data in the Data pane.

how to calculate percentage in power bi using measure

2. Under the Home tab, click on New measure.

percentage of total measure power bi

3. In the formula bar put the below expression. Then click commit.

Total Sales = SUM('Financial Sample'[ Sales])

Where:

  • Total Sales = Name of the Measure
  • SUM = DAX Function
  • Financial Sample = Name of the Table
  • Sales = Name of the Column

4. Under the Home tab, expand Visual gallery(black box) -> Click the Table visual.

power bi display measure as percentage

5. Then, using the +Add data option, add Product and Total Sales into the Columns field.

calculate percentage measure power bi

We will create a new measure called All Sales to remove filters from the Product column. To do this, follow the below steps:

6. Under the Home tab, click on New measure.

percentage of total measure power bi

7. In the formula bar put the below expression. Then click commit.

All Sales = CALCULATE([Total Sales],ALL('Financial Sample'[Product]))

Where:

  • All Sales = Name of the New Measure
  • CALCULATE = DAX Function
  • Total Sales = Name of the Measure
  • ALL = DAX Function
  • Financial Sample = Name of the Table
  • Product = Name of the Column
How to Calculate Percentage of Total in Power BI

To calculate the percent of the total, we’ll create a new measure called “% of Total,” which utilizes the DIVIDE function to divide “Total Sales” by “All Sales,” with a zero as the optional alternate result. To do this, follow the below steps:

8. Under the Home tab, click on New measure.

percentage of total measure power bi

9. In the formula bar put the below expression. Then click commit.

% of total = DIVIDE([Total Sales],[All Sales],0)

Where:

  • % of total = Name of the New Measure
  • DIVIDE = DAX Function
  • Total Sales = Name of the Measure
  • All Sales = Name of the Measure
power bi percentage of total measure

10. Now, change the format to show percentages. To do this, Select % of the total, and under Measure tools, click the ‘%‘ icon.

power bi dax percentage of total measure

11. Then, using the +Add data option, add % of total into the Column field in the Power BI table visual.

power bi percentage of total quick measure

12. After that, see the percentage total in the Power BI table visual.

Power BI Percent of Total Measure

This way, you can calculate the percentage of the total in Power BI measure.

Conclusion

Now, you have a basic understanding of calculating percentages in Power BI. This tutorial taught us how to calculate the percentage of the total in a Power BI measure using a simple scenario.

Moreover, you may like some more Power BI tutorials: