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!Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now
Hi,
I have the following input data:
| User | Country | URL |
| AAA | UK | www.test.com |
| AAA | UK | www.aaa.com |
| BBB | UK | www.bbb.com |
| BBB | UK | www.zzz.com |
| CCC | UK | www.fff.com |
| AAA | USA | www.test.com |
| AAA | USA | www.aaa.com |
| BBB | USA | www.bbb.com |
| BBB | Japan | www.zzz.com |
| CCC | Japan | www.fff.com |
| CCC | Japan | www.zzz.com |
| CCC | Australia | www.zzz.com |
| CCC | Australia | www.zzz.com |
| DDD | UK | www.aaa.com |
| BBB | UK | www.aaa.com |
| BBB | UK | www.aaa.com |
| AAA | USA | www.test.com |
| AAA | USA | www.test.com |
I have created a pivot to show you the results i want to achieve:
| Country | URL COUNT | RANK ORDER |
| UK | 8 | 1 |
| USA | 5 | 2 |
| Japan | 3 | 3 |
| Australia | 2 | 4 |
RankOrder = RANKX(ALL(SiteVisits),count(SiteVisits[url),,DESC)
The results i am getting are as follows:
Row LabelsCount of URLGrand Total18
| Country | URL Count | RankOrder |
| UK | 8 | 8 |
| USA | 5 | 5 |
| Japan | 3 | 3 |
| Australia | 2 | 2 |
What do i need to add to the RANK calculation to yield the expected result above?
Solved! Go to Solution.
Please make this measure
To learn more about Power BI, follow me on Twitter or subscribe on YouTube.
Please make this measure
To learn more about Power BI, follow me on Twitter or subscribe on YouTube.
Thanks for response @mahoneypat , this looks like it works on the sample data...however when i use it on another similar but larger dataset it doesnt work....
Check out the November 2025 Power BI update to learn about new features.
Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!
| User | Count |
|---|---|
| 103 | |
| 80 | |
| 59 | |
| 51 | |
| 46 |