Don't miss your chance to take the Fabric Data Engineer (DP-600) exam for FREE! Find out how by attending the DP-600 session on April 23rd (pacific time), live or on-demand.
Learn moreJoin the FabCon + SQLCon recap series. Up next: Power BI, Real-Time Intelligence, IQ and AI, and Data Factory take center stage. All sessions are available on-demand after the live show. Register now
Hi,
I'm working on a dataset where I want to rank based on a label. The table does not have unique values due to sales happening for the same label type in multiple countries at the same day. I've watched the RANKX video by SQLBI where it needs to be unique values based on the customer code, it's not possible here due to the same value not being unique. How would you tackle the issue? With a crossjoin? It doesn't return the correct value if i'm using the following DAX measure:
Appreciate any help.
Kind regards,
JL
Hi @Anonymous ,
According my understanding, you want to sort article_count by each label and country.
If so, please create a measure:
measure =
RANKX (
FILTER (
ALL ( 'planned_and_purchased' ),
'planned_and_purchased'[Label ID] = MAX ( 'planned_and_purchased'[Label ID] )
&& 'planned_and_purchased'[country] = MAX ( 'planned_and_purchased'[country] )
),
CALCULATE ( SUM ( planned_and_purchased[article_count] ) ),
,
DESC,
DENSE
)
Output:
If not, please share more information (tables, outputs) to help us clarify your scenario. Or share me with your pbix file after removing sensitive data.
Refer to:
How to provide sample data in the Power BI Forum - Microsoft Power BI Community
How to Get Your Question Answered Quickly - Microsoft Power BI Community
Best Regards,
Jinwei Li
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Please provide sample data
Proud to be a Super User!
Paul on Linkedin.
Check out the April 2026 Power BI update to learn about new features.
If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.
A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.
| User | Count |
|---|---|
| 48 | |
| 46 | |
| 41 | |
| 20 | |
| 17 |
| User | Count |
|---|---|
| 70 | |
| 69 | |
| 32 | |
| 27 | |
| 26 |