The ultimate Fabric, Power BI, SQL, and AI community-led learning event. Save €200 with code FABCOMM.
Get registeredEnhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.
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?
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.
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
User | Count |
---|---|
12 | |
9 | |
6 | |
6 | |
6 |
User | Count |
---|---|
24 | |
14 | |
14 | |
9 | |
7 |