Forum Discussion

mamoormasoomi's avatar
8 years ago
Solved

Compare text rows and return result in numeric

Hello,  Please check the below screenshot and help me to resolve this issue.
  • Eric_Zhang's avatar
    8 years ago

    mamoormasoomi wrote:

    Hello, 

    Please check the below screenshot and help me to resolve this issue.


    mamoormasoomi

    To get the expected output, the first step is sorting by Key1 ascending and adding an index column to determine the rows order.

     

    Then create a calculated column

    Result Key = 'Table'[Index]-MINX(FILTER('Table',EARLIER('Table'[Key1])='Table'[Key1]),'Table'[Index])+1

     

    See more details in the attached pbix file.