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
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.
A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.
| User | Count |
|---|---|
| 48 | |
| 40 | |
| 37 | |
| 20 | |
| 16 |
| User | Count |
|---|---|
| 69 | |
| 67 | |
| 32 | |
| 27 | |
| 26 |