Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
5 years ago

How do I RANKX over text duplicates?

Hi,

 

I've tried some of the examples of text rankings in this forums, with little to no success.

 

Here's what I'd like to achieve:

My goal - filtering out all values that are different than 1 using a measure.
I can't use calculated columns because I'm using a Live Connection method over a Tabular Model.

 

Any help would be appreciated!

 

12 Replies

  • mahoneypat's avatar
    mahoneypat
    Microsoft Employee

    Is there another column that can be used to tell which row is first (index, datetime, etc.)?  That will make it much easier to write the needed DAX measure.

    Regards,

    Pat

     

    • Anonymous's avatar
      Anonymous
      Not applicable

      mahoneypat 

      Hi, 

      Ive found another unique column I can sort this by. What would the syntax be like?

      I tried the suggestions below here to no avail..

    • Anonymous's avatar
      Anonymous
      Not applicable

      amitchandak 

      Hi, thanks for the help but I can't use "Edit Queries", because I'm using live connection, which disables that feature.

      I also tried the COUNTX example but PBI throws an error, saying the syntax is wrong.

  • Anonymous's avatar
    Anonymous
    Not applicable

    Anyone?

    I'm still trying using RANKX using the index column, but every row gets the value 1 for some reason..

    • mahoneypat's avatar
      mahoneypat
      Microsoft Employee

      Can you describe more about the analysis you plan to do once you have the desired column?  I expect there is a different approach with DAX that you get your result with a live connection.

       

      Regards,

      Pat

       

      • Anonymous's avatar
        Anonymous
        Not applicable

        As I've mentioned in my first message - my intention is to only show the rows with the value 1 (after ranking). I don't need to display the duplicates, any instance of a certain ID is enough for my analysis. 

         

        So if this is my data:

        ID         |     Desc

        123           text1

        123           text2

        456           text1

         

        I don't care which row of ID 123 gets rank #1.

        I want to rank my entire table so every ID is displayed one time only. Super easy for me in SQL but seems impossible in DAX.