Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
6 years ago
Solved

Create ascending index column by DAX based on row values

Dear friends

 

please guide me how can i create calculated index column that show ascending number based on value column like attached in data interfaces.

 

NameValueIndex
a102
b101
a51
b152
b203
c102
c51
a153
  • Anonymous , Create a new column like

    countx(filter(Table, [Name] = earlier([Name]) && [Value] <= earlier([Value])),[Value])

  • Anonymous ,

    Try this column:

    index =
    RANKX (
    FILTER (
    Sheet4,
    EARLIER ( Sheet4[Name] ) = Sheet4[Name]
    ), Sheet4[Value],,
    ASC
    )

5 Replies

  • Anonymous , Create a new column like

    countx(filter(Table, [Name] = earlier([Name]) && [Value] <= earlier([Value])),[Value])

  • Anonymous ,

    Try this column:

    index =
    RANKX (
    FILTER (
    Sheet4,
    EARLIER ( Sheet4[Name] ) = Sheet4[Name]
    ), Sheet4[Value],,
    ASC
    )
  • Anonymous ,

    Please see a below Screen shot with output:

  • Mariusz's avatar
    Mariusz
    Icon for Community Champion rankCommunity Champion

    Hi Anonymous 

     

    Try this 

    Column = 
    VAR __name = 'Table'[Name]
    VAR __tbl = FILTER( 'Table', 'Table'[Name] = __name )
    RETURN 
    RANKX( __tbl, 'Table'[Value],, ASC  )

     

    Best Regards,
    Mariusz

    If this post helps, then please consider Accepting it as the solution.

    Please feel free to connect with me.
    LinkedIn