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
kirawaters
Frequent Visitor

Calculate percentage of same group

Hello, I'm trying to figure out how to calculate the percentage of the same group using a measure. If I can't do it in a measure, I at least need to be able to do it in a column on the same table. If my data were split between two tables, I would use PercentageofItem = thistable[sold]/sumx(filter(thattable, thattable[item#]=thistable[item#]. 

Below is an image of what I'm trying to do: my table has products, and the number of those products sold by which salesperson. I need to know for each line what percentage of sales it is for it's type of product. My dataset includes thousands of products and thousands of people, so I don't want to see it the way the summary shows it, just on a line-by-line basis how much of the total of that type of product is this line referring to? I want the solutions in row D that can be found using the excel formula there.

kirawaters_0-1630622617385.png

 

2 REPLIES 2
amitchandak
Super User
Super User

@kirawaters , Try a measure like

divide(sum(thistable[sold])/calculate(sum(thistable[sold]) , filter(allselected(thattable), thattable[item#]=max(thistable[item#] ))))

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

That's an interesting solution. The problem is that thattable doesn't exist. Everything is on thistable. Is there a way to do it with all of the relevant data being on a single table?

 

Helpful resources

Announcements
July 2025 community update carousel

Fabric Community Update - July 2025

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

July PBI25 Carousel

Power BI Monthly Update - July 2025

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