This is best Fabric, Power BI, SQL and AI community event. How do we know? The last event sold out! Save €200 with code FABCMTY200.
Register nowA 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.
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
| Customer Number | Order Number | Order Date | Product Number | Ordered |
| 1 | 1 | 17/01/2025 | 12 | First |
| 1 | 1 | 17/01/2025 | 13 | First |
| 1 | 1 | 17/01/2025 | 14 | First |
| 1 | 2 | 20/01/2025 | 12 | |
| 1 | 2 | 20/01/2025 | 15 | |
| 1 | 2 | 20/01/2025 | 16 | |
| 2 | 3 | 18/01/2025 | 21 | First |
| 2 | 3 | 18/01/2025 | 25 | First |
| 2 | 4 | 31/01/2025 | 26 | |
| 2 | 4 | 25/01/2025 | 21 | |
| 2 | 4 | 25/01/2025 | 25 | |
| 3 | 5 | 18/01/2025 | 21 | First |
| 3 | 6 | 19/01/2025 | 23 |
Solved! Go to Solution.
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.
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
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.
Check out the May 2026 Power BI update to learn about new features.
Sign up to receive a private message when registration opens and key events begin.
If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.
| User | Count |
|---|---|
| 29 | |
| 27 | |
| 25 | |
| 19 | |
| 14 |
| User | Count |
|---|---|
| 56 | |
| 48 | |
| 37 | |
| 21 | |
| 20 |