Learn from the best! Meet the four finalists headed to the FINALS of the Power BI Dataviz World Championships! 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
| User | Count |
|---|---|
| 58 | |
| 44 | |
| 31 | |
| 17 | |
| 16 |
| User | Count |
|---|---|
| 77 | |
| 66 | |
| 44 | |
| 24 | |
| 22 |