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!Learn from the best! Meet the four finalists headed to the FINALS of the Power BI Dataviz World Championships! Register now
Hi All,
I have a table in which date wise details of client visited is given. I am calculating the number of visits to top 10 frequently visited clients using TopN formula. The formula is as follow -
=CALCULATE([# Visits], TOPN(10, ALL(OutletVisit[Partner ID]), [# Visits]))
Now the problem is that for some Partner IDs the number of visits are same and the formula is taking all such clients as one. If I use the formula =CALCULATE([# Visits], TOPN(1, ALL(OutletVisit[Partner ID]), [# Visits])) then it returns 49 instead of 7.
Partner ID #Visits # Visit/Client
| 9956988658_1479279774696 | 7 | 7.00 |
| 9956988658_1546247476667 | 7 | 7.00 |
| 9956988658_1594019340191 | 7 | 7.00 |
| 9956988658_1476956382273 | 7 | 7.00 |
| 9956988658_1547714072698 | 7 | 7.00 |
| 9956988658_1477309773096 | 7 | 7.00 |
| 9956988658_1545038645694 | 7 | 7.00 |
How to solve this issue. Kindly help
Solved! Go to Solution.
Hi @rohanjha1988 ,
Try this:
Measure = CALCULATE([# Visits], TOPN(10, VALUES(OutletVisit[Partner ID]), [# Visits]))
If this doesn't work, please share us more details.
Best Regards,
Icey
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi @rohanjha1988 ,
Try this:
Measure = CALCULATE([# Visits], TOPN(10, VALUES(OutletVisit[Partner ID]), [# Visits]))
If this doesn't work, please share us more details.
Best Regards,
Icey
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
@rohanjha1988 , Create a Rank and use that in Top 10
rank = rankx(ALL(OutletVisit[Partner ID]),[# Visits],,desc,dense) + rand()/100
CALCULATE([# Visits], TOPN(10, ALL(OutletVisit[Partner ID]), [rank]), values(OutletVisit[Partner ID]))
Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.
Check out the February 2026 Power BI update to learn about new features.
| User | Count |
|---|---|
| 52 | |
| 50 | |
| 34 | |
| 15 | |
| 14 |
| User | Count |
|---|---|
| 94 | |
| 77 | |
| 41 | |
| 26 | |
| 25 |