This time we’re going bigger than ever. Fabric, Power BI, SQL, AI and more. We're covering it all. You won't want to miss it.
Learn moreDid you hear? There's a new SQL AI Developer certification (DP-800). Start preparing now and be one of the first to get certified. Register now
Hello Everyone, I am fairly new to PBI and I am having trouble with the rank x function.
I have four columns: SKU, Vendor, Total Instock, Total Count (See below for table).
SKU |
| Vendor | Total Instock | Total Count |
123456 |
| 10 | 100 | 125 |
456789 |
| 10 | 155 | 1478 |
147852 |
| 10 | 418 | 1025 |
258963 |
| 5 | 748 | 2588 |
369852 |
| 25 | 369 | 1478 |
123789 |
| 25 | 348 | 500 |
456357 |
| 31 | 256 | 900 |
159753 |
| 31 | 248 | 300 |
So far, I created the measure:
Solved! Go to Solution.
Hi @Anonymous ,
Try ALLEXCEPT() function.
rank sku = RANKX(ALLEXCEPT('In Stock','In Stock'[Vendor]),'In Stock'[Instock %],,DESC)
Best Regards,
Jay
Hi @Anonymous ,
Try ALLEXCEPT() function.
rank sku = RANKX(ALLEXCEPT('In Stock','In Stock'[Vendor]),'In Stock'[Instock %],,DESC)
Best Regards,
Jay
Hi @Anonymous ,
Try
Measure rank vendor = RANKX(ALL('Table'[Vendor],'Table'[SKU]),[Measure Instock %],,DESC)
https://radacad.com/how-to-use-rankx-in-dax-part-1-of-3-calculated-columns
https://radacad.com/how-to-use-rankx-in-dax-part-2-of-3-calculated-measures
Regards,
Harsh Nathani
Appreciate with a Kudos!! (Click the Thumbs Up Button)
Did I answer your question? Mark my post as a solution!
Harsh,
I tried this, but it returned random numbers that did not rank the vendors.
-gps0014
Hi @Anonymous ,
Returning correct for me based on the data you shared.
Hi @Anonymous ,
Can you share the screenshot of your visualization ?
Regards,
HN
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.
| User | Count |
|---|---|
| 37 | |
| 37 | |
| 31 | |
| 21 | |
| 16 |
| User | Count |
|---|---|
| 66 | |
| 56 | |
| 31 | |
| 26 | |
| 23 |