Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.
Register now!The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more
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
The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!
| User | Count |
|---|---|
| 39 | |
| 37 | |
| 33 | |
| 32 | |
| 29 |
| User | Count |
|---|---|
| 133 | |
| 88 | |
| 85 | |
| 68 | |
| 64 |