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

To celebrate FabCon Vienna, we are offering 50% off select exams. Ends October 3rd. Request your discount now.

Reply
WOLFIE
Helper I
Helper I

Count by MIN RANK per category

Hi all,

 

I am trying to count users per category for the lowest RANK in between the selected dates. The calculation has to be dynamic, working with the data slicer

 

Any help would be appreciated.

 

As you can see my User Count isn't correct. Thanks 🙂

WOLFIE_0-1668096483268.png

Sample data that I used :

CategoryUserDateRANK

a123/11/20223
b116/08/20224
b130/07/20225
c111/02/20227
c107/03/20231
d127/01/20232
d112/05/20226
a209/01/20227
a208/02/20226
a225/02/20231
c221/01/20232
c217/11/20223
b227/05/20224
d220/03/20225
c315/05/20225
c314/03/20226
d330/12/20224
d301/01/20233
a317/01/20232
a303/03/20231
a421/11/20222
b414/02/20224
b419/02/20231
c406/04/20223
c521/09/20223
d525/11/20221
d508/03/20225
a525/09/20222
a507/08/20224
a626/02/20231
c610/03/20224
c623/06/20222
b630/04/20223
d717/04/202210
c720/01/20233
d721/04/20229
d701/03/20231
a718/10/20226
a728/01/20232
a708/10/20227
c710/11/20224
c721/08/20228
b704/11/20225
d822/11/20223
c826/01/20231
c819/01/20232
d830/03/20224
d813/03/20225
1 ACCEPTED SOLUTION
v-yueyunzh-msft
Community Support
Community Support

Hi , @WOLFIE 

According to your description, you want to get the " count users per category for the lowest RANK".

Here are the steps you can refer to :

(1)My test data is the same as yours.

(2)We can create a measure :

Measure = var _lowest_rank = MAX('Table'[Rank])
var _t =DISTINCT(SELECTCOLUMNS(FILTER('Table', 'Table'[Rank] = _lowest_rank) ,"User" , [User]))
return
COUNTROWS(_t)

(3)Then we can meet your need , the result is as follows:

vyueyunzhmsft_0-1668135068976.png

If this method does not meet your needs, you can provide us with your special sample data and the desired output sample data in the form of tables, so that we can better help you solve the problem.

 

Best Regards,

Aniya Zhang

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

2 REPLIES 2
v-yueyunzh-msft
Community Support
Community Support

Hi , @WOLFIE 

According to your description, you want to get the " count users per category for the lowest RANK".

Here are the steps you can refer to :

(1)My test data is the same as yours.

(2)We can create a measure :

Measure = var _lowest_rank = MAX('Table'[Rank])
var _t =DISTINCT(SELECTCOLUMNS(FILTER('Table', 'Table'[Rank] = _lowest_rank) ,"User" , [User]))
return
COUNTROWS(_t)

(3)Then we can meet your need , the result is as follows:

vyueyunzhmsft_0-1668135068976.png

If this method does not meet your needs, you can provide us with your special sample data and the desired output sample data in the form of tables, so that we can better help you solve the problem.

 

Best Regards,

Aniya Zhang

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly

 

amitchandak
Super User
Super User

@WOLFIE , TOP N should help

 

calculate(Count(Table[User]), TOPN(1, allselected(Table[Category]) ,calculate(Count(Table[User])) , desc) , Values(Table[Category]))

 

TOPN: https://youtu.be/QIVEFp-QiOk

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

Helpful resources

Announcements
September Power BI Update Carousel

Power BI Monthly Update - September 2025

Check out the September 2025 Power BI update to learn about new features.

August 2025 community update carousel

Fabric Community Update - August 2025

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