Power BI is turning 10! Tune in for a special live episode on July 24 with behind-the-scenes stories, product evolution highlights, and a sneak peek at what’s in store for the future.
Save the dateEnhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.
Hi Community,
I'm trying to calculate the rank of the number of occurrences taking place of email addresses. However, while calculating the rank I also want to ensure a filter is applied (based on who has attended). Below is an example of my dataset
Forum | Attended | |
Forum 1 | aa@abc.com | Attended |
Forum 2 | aa@abc.com | Not Attended |
Forum 1 | bb@abc.com | Attended |
Forum 3 | cc@abc.com | Attended |
Forum 1 | cc@abc.com | Not Attended |
Forum 2 | cc@abc.com | Attended |
In the above table, the result should show cc@abc.com as Rank 1 as they have attended two forums. However, if I filter on Forum 1, then aa@abc.com & bb@abc.com should be rank 1.
I have written a measure which looks as follows:
RANKX(ALLSELECTED(MyTable),CALCULATE(COUNT(MyTable[Email]),FILTER(ALLEXCEPT(MyTable,Mytable[Email]),MyTable[Attended] = "Attended")),,DESC,Dense)
@Anonymous Despite it's name, this article actually has quite a bit of good knowlege on how to use RANKX:
https://community.powerbi.com/t5/Quick-Measures-Gallery/To-Bleep-with-RANKX/m-p/1042520#M452
@ me if you still need assistance.
Thanks for sharing this across. I've tried to troubleshoot it using the guide, however, I'm still facing an issue with the ranks.
So what I've tried to also do is break up the calculation into 2 measures: the first one calculates the count with the underlying filter logic, and the second measure ranks the count calculated from the first. I've rewritten the formulas below:
@Anonymous Try:
Rank = RANKX(ALL(myTable),[Count],,DESC,Dense)
or
Rank = RANKX(ALLSELECTED(myTable),[Count],,DESC,Dense)
Hi @Greg_Deckler yeah I tried your versions of the formula as well, but I'm unfortunately getting the same results.
I did however, manage to find this article which seemed to be doing the trick. From the formulas marked as the solution, I took the version which creates temporary tables, and I changed the sum calculations in the 'summry' table to the count formula I had.
I don't think I would have ever gotten to that answer by myself 😂
Check out the July 2025 Power BI update to learn about new features.
This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.
User | Count |
---|---|
19 | |
7 | |
6 | |
5 | |
5 |
User | Count |
---|---|
25 | |
10 | |
10 | |
9 | |
6 |