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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
JohnDahis
Helper III
Helper III

Total line of Table, Percentage calculation from sum of columns

Good day!

 

With this data, I am building a simple table, showing the Total at the bottom.

p.s. the Earn% = (Sell - Buy) / Buy

 

NameBuySellEarn %
John748413.5%
Kate505714.0%
Peter467358.7%

 

In PowerBI, it gives me a table. the Total Earn% I want it to show 25.9%, which is from (214 - 170) / 170 (instead of a sum of the Earn% column).

 

How can I do that? Thank you.

 

 

 

1 ACCEPTED SOLUTION

Hi @JohnDahis ,

 

You may try to use a measure. You can find New Measure on the Home Tab.

v-xuding-msft_3-1594703120881.png

 

Click and create a new measure (Earn %) as below:

 

Earn % = 
var buy = SUM('Table'[Buy])
var sell = SUM('Table'[Sell])
return
DIVIDE(sell - buy,buy)

 

5.PNG

 

Best Regards,
Xue Ding
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

4 REPLIES 4
amitchandak
Super User
Super User

@JohnDahis ,  Try like

Earn % new = sumx(values(Table[Name]),[Earn %])

 

In place [Earn %] , you have its calculation

@amitchandakthank you for your reply and adivse.

 

I folloewed the same, however it doesn't return what's wanted. How can I correct it? Thanks.

 

Sample.png

 

 

Hi @JohnDahis ,

 

You may try to use a measure. You can find New Measure on the Home Tab.

v-xuding-msft_3-1594703120881.png

 

Click and create a new measure (Earn %) as below:

 

Earn % = 
var buy = SUM('Table'[Buy])
var sell = SUM('Table'[Sell])
return
DIVIDE(sell - buy,buy)

 

5.PNG

 

Best Regards,
Xue Ding
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

@v-xuding-msft , that's amazing! thank you!

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

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