Forum Discussion

karthik69's avatar
karthik69
Frequent Visitor
4 years ago
Solved

Dynamic RANKX on text column based on Slicer and also user selection from Chart and table

Hello All,

 

Thank you for reading my post.

 

I did currently ranked based on a Fields, Name and Team on all the data available in the report.

So the Rank is based on Name .....and it will rank Team members . A calculated Column was created which will rank all the data based on below formula

Whenever user does some selections on Slicer, or Select some record on table or select from Charts, I want to dynamically rank.

 I created following measure , however it is not ranking as expected.....

 

Can someone please help me to achieve dynamic ranking for my scenario and data.

 

Regards

Karthik

 

  • karthik69 , Create a measure like


    Countx(filter(allselected(Table), Table[Team] = Max(table[Team]) &&  Table[Name] <= max(Table[Name]) ) , Table[Name])

  • Hi karthik69 ,

     

    Could you tell me if your problem has been solved? If it is, kindly Accept it as the solution. More people will benefit from it. Or if you are still confused about it, please provide me with more details about your table and your problem or share me with your pbix file after removing sensitive data.

    Refer to:

    How to provide sample data in the Power BI Forum

    How to Get Your Question Answered Quickly

     

    Best Regards,

    Jianbo Li

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

4 Replies

  • karthik69 , Create a measure like


    Countx(filter(allselected(Table), Table[Team] = Max(table[Team]) &&  Table[Name] <= max(Table[Name]) ) , Table[Name])

    • karthik69's avatar
      karthik69
      Frequent Visitor

      Thanks amitchandak for the reply..

       

      I forgot to mention the Team names can repeat . Example

       

       

      I still see the rank incorrect and it is getting 1 in most of the cases 

       

      Regards

      Karthik

  • Hi karthik69 ,

     

    Please try:

    Rank =
    
    var _a = SUMMARIZE(ALLSELECTED('Table'),'Table'[Name],'Table'[Team])
    
    var _b = ADDCOLUMNS(_a,"Rank",RANKX(FILTER( _a,[Name]=SELECTEDVALUE('Table'[Name])),[Team],,ASC,Dense))
    
    return MAXX(FILTER(_b,[Name]=SELECTEDVALUE('Table'[Name])&&[Team]=SELECTEDVALUE('Table'[Team])),[Rank])

    Output:

     

     

    Best Regards,

    Jianbo Li

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

  • Hi karthik69 ,

     

    Could you tell me if your problem has been solved? If it is, kindly Accept it as the solution. More people will benefit from it. Or if you are still confused about it, please provide me with more details about your table and your problem or share me with your pbix file after removing sensitive data.

    Refer to:

    How to provide sample data in the Power BI Forum

    How to Get Your Question Answered Quickly

     

    Best Regards,

    Jianbo Li

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