Power BI is turning 10! Tune in for a special live episode on July 24 with behind-the-scenes stories, product evolution highlights, and a sneak peek at what’s in store for the future.
Save the dateEnhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.
Dear All,
What I am trying to achieve is to rank top 10 customers by Gross Margin % (which is a calculated measure). I have two DAX formula as follows:
Any ideas where I am making an error?
My expected output is:
Customer A - Gross Margin % 65% - Rank 1
Customer B - Gross Margin % 65% - Rank 2
etc.
Any help appreciated.
Thank you!
Solved! Go to Solution.
Thank you for your suggestions and time. In the end, I decided to have an entirely different approach to creating a page with margin information, top and bottom performers, both customers and products.
Hi @Giorgi1989
Can you please advise what are you slicing by in your matrix? Why are you taking the MAXX of the TOPN(10)? As this is just the same as simple MAXX
Hi,
Thank you for the quick reply.
I use 'calendar month' to slice the matrix.
@Giorgi1989
You may try the following
Customer rank based on GM% =
RANKX (
FILTER ( 'Customer (Margin)', 'Customer (Margin)'[Gross Margin %] <> BLANK () ),
[Gross Margin %],
,
DESC
)
Top 10 customers by GM% =
IF (
NOT ( ISBLANK ( [Gross Margin %] ) ),
MAXX (
ADDCOLUMNS ( 'Customer (Margin)', "@GrossMagin", [Gross Margin %] ),
[@GrossMagin]
)
)
Thank you for your suggestions and time. In the end, I decided to have an entirely different approach to creating a page with margin information, top and bottom performers, both customers and products.
User | Count |
---|---|
25 | |
12 | |
8 | |
6 | |
6 |
User | Count |
---|---|
26 | |
12 | |
11 | |
10 | |
6 |