Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

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.

Reply
eddydm
Advocate II
Advocate II

Ranking and measure and additonal filters

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?

1 ACCEPTED SOLUTION
v-yulgu-msft
Employee
Employee

Hi @Daniil,

 

Please try below measures:

Count transaction = COUNT('User-transaction'[TransactionID])

Rank value = RANKX(ALLSELECTED('User-transaction'[User]),[Count transaction],,DESC,Dense)

1.PNG2.PNG

 

Best regards,

Yuliana Gu

Community Support Team _ Yuliana Gu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

4 REPLIES 4
v-yulgu-msft
Employee
Employee

Hi @Daniil,

 

Please try below measures:

Count transaction = COUNT('User-transaction'[TransactionID])

Rank value = RANKX(ALLSELECTED('User-transaction'[User]),[Count transaction],,DESC,Dense)

1.PNG2.PNG

 

Best regards,

Yuliana Gu

Community Support Team _ Yuliana Gu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Hi @v-yulgu-msft

 

Thanks for your example. This has sent me to the solution.

I had forgotten to use the allselected (users) in the rankx formula!

 

 

Daniil
Kudo Kingpin
Kudo Kingpin

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.

 

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.

Top Solution Authors