Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

A new Data Days event is coming soon! This time we’re going bigger than ever. Fabric, Power BI, SQL, AI and more. Don't miss out.

Reply
maurcoll
Helper IV
Helper IV

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 and order date = min order date but it doesn't seem to be working, i just get blanks.  I am trying to create it as a calculated column

var earliestdate = CALCULATE(MIN('customer'[Order Date]),
                        FILTER('customer', 'customer' [Customer Number] = EARLIER( 'customer' [Customer Number])))


RETURN
IF(Order Date = earliestdate , "First", BLANK())

Customer NumberOrder NumberOrder DateProduct NumberOrdered
1117/01/202512First
1117/01/202513First
1117/01/202514First
1220/01/202512 
1220/01/202515 
1220/01/202516 
2318/01/202521First
2318/01/202525First
2431/01/202526 
2425/01/202521 
2425/01/202525 
3518/01/202521First
3619/01/202523 
1 ACCEPTED SOLUTION
pankajnamekar25
Super User
Super User

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.

View solution in original post

2 REPLIES 2
Sasidhar1
Regular Visitor

Hi @maurcoll , 

Hope you are doing well.

I can see there is no issue with  the dax what you have written and the output is also expected as we are having different dates for a customer number that was mapped to blank and for customer for min order date is mapped to First.

 

Let us know what is the output you are expecting.

 

Thanks

pankajnamekar25
Super User
Super User

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.

Helpful resources

Announcements
May Power BI Update Carousel

Power BI Monthly Update - May 2026

Check out the May 2026 Power BI update to learn about new features.

Fabric SQL PBI Data Days

Data Days 2026 coming soon!

Sign up to receive a private message when registration opens and key events begin.

New to Fabric survey Carousel

New to Fabric Survey

If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.