Forum Discussion

maurcoll's avatar
maurcoll
Helper IV
1 year ago
Solved

First/earliest Date

Hi  i am trying to work out which is the earliest/First order date per customer as per the below. I have been trying to use the earlier function where the customer number = earlier customer number a...
  • pankajnamekar25's avatar
    1 year ago

    Hello maurcoll 

     

    Us this DAX to create calculated column

    Ordered =

    VAR EarliestDate =

        CALCULATE(

            MIN('customer'[Order Date]),

            ALLEXCEPT('customer', 'customer'[Customer Number])

        )

    RETURN

        IF('customer'[Order Date] = EarliestDate, "First", BLANK())

     

    Thanks,
     Pankaj Namekar | LinkedIn

    If this solution helps, please accept it and give a kudos (Like), it would be greatly appreciated.