The ultimate Fabric, Power BI, SQL, and AI community-led learning event. Save €200 with code FABCOMM.
Get registeredCompete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.
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 |
---|---|
17 | |
8 | |
7 | |
6 | |
6 |
User | Count |
---|---|
26 | |
13 | |
12 | |
9 | |
8 |