Forum Discussion

WOLFIE's avatar
WOLFIE
Helper I
3 years ago
Solved

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 🙂

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
  • 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:

    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

     

2 Replies

  • 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:

    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