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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply
nschmidt
Frequent Visitor

Finding Max value of a category by part

I have the folloiwng sample data set...

 

I need to calculate Max Sales of Customer by the part number and figure out what % of their sales are in the top customer. I have Part Number, Customer, and Sales in my data set... how do I calculate the next 2 in dax?

 

nschmidt_1-1617126245573.png

 

 

 

2 REPLIES 2
Jihwan_Kim
Super User
Super User

Hi, @nschmidt 

Please check the below measures.

The link to the sample pbix file is down below.

 

 

 

Max Sales of Customer by Part No =
IF (
HASONEVALUE ( 'Table'[Part Number] ),
CALCULATE (
MAXX ( 'Table', 'Table'[Sales] ),
ALLEXCEPT ( 'Table', 'Table'[Part Number] )
),
BLANK ()
)

 

Percentage of Max =
IF (
HASONEVALUE ( 'Table'[Part Number] ),
DIVIDE (
[Max Sales of Customer by Part No],
CALCULATE (
SUMX ( 'Table', 'Table'[Sales] ),
ALLEXCEPT ( 'Table', 'Table'[Part Number] )
)
),
BLANK ()
)

 

https://www.dropbox.com/s/3g8nnszt7p0x46e/nschmidt.pbix?dl=0 

 

Hi, My name is Jihwan Kim.

If this post helps, then please consider accept it as the solution to help other members find it faster.


If this post helps, then please consider accepting it as the solution to help other members find it faster, and give a big thumbs up.


Click here to visit my LinkedIn page

Click here to schedule a short Teams meeting to discuss your question.

Sorry i should have specified... customer and sales are on different tables with one way relationships Customer points to Sales, Part number points to sales as well 

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.