How to Calculate Percentage of Two Columns in Power BI

In this Power Bi tutorial, we will discuss how to calculate percentage of two columns in Power BI, In addition, we will also learn how to calculate the percentage difference between two columns in Power BI.

Power BI Calculate the Percentage of Two Columns

Here we will see how we can calculate the Percentage of two columns in the Power BI report.

In this example, we will use the below-mentioned Daily Rate sample data consisting of two sheets called Monthly Rate and Monthly Target to calculate the percentage value of two columns in Power BI.

Monthly Rate:

Power BI Calculate Percentage of Two Columns
Power BI Calculate the Percentage of Two Columns

Monthly Target:

Power BI Calculate Percentage of Two Columns example
Power BI Calculate Percentage of Two Columns example
  • Load data into the Power Bi desktop, Click on the new measure and apply the below formula to calculate the percentage value of two columns.
% Achieved = 
VAR Month_Rates =
    SUM ('Monthly Rate'[Rate] )
VAR Target_Rates =
    SUM ('Monthly Target'[Target] )
RETURN
    ( Month_Rates - Target_Rates )
        / Month_Rates

Where,

  1. % Achieved = Measure Name
  2. Month_Rates, Target_Rates = Variable Names
  3. Monthly Rate, Monthly Target = Table Names
  • Select the table visual from the visualization, drag-drop the year, month, rate, and target fields from the field pane, and the created % Achieved measure value in it as highlighted below:
Example of Power BI Calculate Percentage of Two Columns
Example of Power BI Calculate Percentage of Two Columns
  • To show Percentages change the format to a percentage by selecting Measure tools -> Percentage as highlighted below:
  • The screenshot below displays the achieved percentage value based on the condition applied.
Calculate the Percentage of Two Columns in Power Bi
Calculate the Percentage of Two Columns in Power Bi

This is how to calculate percentage of two columns in a Power BI report.

Calculate Percentage difference between Two Columns in Power BI

Let us see how we can calculate the percentage difference between two columns in Power BI,

In this example, first, we will find the difference value between the rate and target columns later we will use the Power Bi Divide function to find the percentage value.

Open the Power Bi desktop and load data into it, and use the below formula to calculate the percentage difference between two columns in Power BI,

% difference = 
VAR MonthRate =  SUM ('Monthly Rate'[Rate] )
VAR MonthTarget =  SUM ('Monthly Target'[Target] )
VAR difference = MonthRate - MonthTarget
VAR Result = DIVIDE (differnce,MonthRate,BLANK())
RETURN Result

Where,

  1. % difference = Measure Name
  2. MonthRate, MonthTarget, difference, Result = Variable Names
  3. Monthly Rate, Monthly Target = Table Names
  4. Rate, Target = Column Names
  • Select the table visual from the visualization, drag-drop the year, month, rate, and target fields from the field pane, and the created % difference measure value in it as highlighted below:
Power BI Calculate the Percentage difference between Two Columns
Power BI Calculate the Percentage difference between Two Columns
  • Select the measure and choose Measure tools -> Percentage as highlighted below to change the measure format to percentage.
  • In the below screenshot, you can see the table visually displays the Calculate Percentage difference between Two Columns Power BI report.
Power BI Calculate the Percentage difference between Two Columns example
Power BI Calculate the Percentage difference between Two Columns example

This is how to calculate the percentage difference between two columns in Power BI.

In this Power Bi tutorial, we have discussed how to calculate percentage of two columns in Power BI. Also, we learned how to calculate the percentage difference between two columns in Power BI.

You may like the following Power BI tutorials:

>