Forum Discussion

MrMarshall's avatar
MrMarshall
Helper II
8 years ago
Solved

New column based on multiple sorted rows

Trying to create a new column based on multiple sorted rows within the same OrderNumber. I have the following schema: Description OrderNumber OrderRow Art 1 30000 10 Art 2 30000 20 ...
  • v-piga-msft's avatar
    8 years ago

    Hi MrMarshall,

     

    You could create a calculated column with dax expression below.

     

    New Column =
    CALCULATE (
        MAX ( 'Order'[Description] ),
        FILTER (
            'Order',
            'Order'[OrderNumber] = EARLIER ( 'Order'[OrderNumber] )
                && 'Order'[OrderRow] = MIN ( 'Order'[OrderRow] )
        )
    )
    

    Then you will get your expected output.

     

     

    Hope this can help you!:smileytongue:

     

    Best Regards,

    Cherry