Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Compete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.

Reply
hkrash0920
Helper I
Helper I

Subtraction of 2 percentage columns with conditional formatting

Hi...I am trying to subtract two different columns that don't sum the total. See below.

 

Capture2.PNG

 

The MMT Diff column is a new column -  MMT Diff = [Current Margin]-[MMT Margin]

The MMT Margin and Current Margin columns are percentages.

 

The Total Row is adding up all the above percentages. I want it to be the same as above to be [Current Margin]-[MMT Margin].

 

This is just a portion of the table to which the Total row doesn't match with the picture. 🙂

 

I assume a measure needs to be created but I can't figure out how.

 

Please help.

 

Thanks

1 ACCEPTED SOLUTION
GabrielSantos
Resolver I
Resolver I

Please try this:

 

Define sums of your MMT and Current Margin with :

=SUM(Table[MMT Margin])

 

 

=SUM(Table1[Current Margin])

 

 

Next, determine the count of your item with :

 

COUNTROWS(Table1)

 

 

These two will enable you to create a weighted average to determine the MMT Diff margin. Create a measure with the following:

 

([Sum MMT Margin]-[Sum Current Margin])/[Count]

 

 

Finally, to get a PivotTable display that makes sense, you're going to want to place the average percentages with the following:

 

 

AVERAGE(Table1[MMT Margin])

 

AVERAGE(Table1[Current Margin])

Place the Average measures and the MMT Diff measure on your PivotTable to yield the following:

 

a1.png

 

 

View solution in original post

1 REPLY 1
GabrielSantos
Resolver I
Resolver I

Please try this:

 

Define sums of your MMT and Current Margin with :

=SUM(Table[MMT Margin])

 

 

=SUM(Table1[Current Margin])

 

 

Next, determine the count of your item with :

 

COUNTROWS(Table1)

 

 

These two will enable you to create a weighted average to determine the MMT Diff margin. Create a measure with the following:

 

([Sum MMT Margin]-[Sum Current Margin])/[Count]

 

 

Finally, to get a PivotTable display that makes sense, you're going to want to place the average percentages with the following:

 

 

AVERAGE(Table1[MMT Margin])

 

AVERAGE(Table1[Current Margin])

Place the Average measures and the MMT Diff measure on your PivotTable to yield the following:

 

a1.png

 

 

Helpful resources

Announcements
August Power BI Update Carousel

Power BI Monthly Update - August 2025

Check out the August 2025 Power BI update to learn about new features.

August 2025 community update carousel

Fabric Community Update - August 2025

Find out what's new and trending in the Fabric community.

Top Solution Authors