Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.
I have (in PowerBI) a table with many transactions done by different users.
I'v made a measure to count the number of transactions. So I can make already a visual with the name of a user and the number of transactions done by that user. This measure is working very well, even when i do some other selections (like a filter for the month in which the transaction is done, ... )
Now I want to do a ranking of the users with the user with the most transactions on top. I would like to show only the five first users, so the 5 users with the greatest number of transactions.
I'v tried already different formules, but sometimes all the users get rank 1 (formula counts only for the transactions for specified user). With another formula the ranking uses the total number of transaction of that user (and doesn't use the other filter 'month of the transaction').
How can I solve this problem?
Solved! Go to Solution.
Hi @Daniil,
Please try below measures:
Count transaction = COUNT('User-transaction'[TransactionID]) Rank value = RANKX(ALLSELECTED('User-transaction'[User]),[Count transaction],,DESC,Dense)
Best regards,
Yuliana Gu
Hi @Daniil,
Please try below measures:
Count transaction = COUNT('User-transaction'[TransactionID]) Rank value = RANKX(ALLSELECTED('User-transaction'[User]),[Count transaction],,DESC,Dense)
Best regards,
Yuliana Gu
Thanks for your example. This has sent me to the solution.
I had forgotten to use the allselected (users) in the rankx formula!
Is there a particular reason why you want to use measures for your task?
As an alternative, you could try sorting your visual (to display the user with the most transactions on top) and filtering it with the Top N filter type (to show only the top five users by transactions).
See here for a video tutorial: https://www.youtube.com/watch?v=i5MRisaNqbU
Thanks for your advises!
I need to use the measure (count of transaction) because it's not included in a table and has to be calculated depending on other filters.
I did already tried sorting the visuals, but my problem was that my ranking formula wasn't correct and so i couldn't use the top N filtertype.
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
110 | |
99 | |
80 | |
64 | |
58 |
User | Count |
---|---|
148 | |
111 | |
93 | |
84 | |
66 |