My sales manager asked a simple question last week: when did each rep close their first deal this year, and what did they sell? Finding the date is one function. Pulling the product and the amount from that same row is where most people get stuck.
In this tutorial, we’ll build four dax min date measures in Power BI Desktop on my 60-order sales file: the first order date, the product and sales on that date, and the days from the first to the last order.
Here’s what we’re building:

Rachel Morgan opened the year on 01/12/2026 with a $1,440 Visio Plan 2 order, which is why the Total row shows that same date and product.
Before You Start
You need Power BI Desktop (free) and a table with a real Date column. My demo file is a Sales table with 60 orders from 01/12/2026 to 09/09/2026. If you’re new to measures, the Power BI tutorials hub covers the basics. These are the first rows, sorted by date:
| OrderID | OrderDate | Region | Product | SalesRep | Sales |
|---|---|---|---|---|---|
| SO-1020 | 01/12/2026 | West | Visio Plan 2 | Rachel Morgan | $1,440 |
| SO-1027 | 01/18/2026 | East | ThinkPad X1 | Rachel Morgan | $8,694 |
| SO-1014 | 01/21/2026 | East | Wireless Mouse | Tyler Brooks | $49 |
| SO-1047 | 01/24/2026 | East | Wireless Mouse | Brian Keller | $392 |
| SO-1010 | 01/30/2026 | South | Surface Laptop 7 | Marcus Hale | $3,897 |
| SO-1042 | 02/04/2026 | East | Visio Plan 2 | Dana Whitfield | $360 |
Add a Table visual with SalesRep on it. Every measure below lands in that visual, so each row gets its own rep’s dates.
Step 1: Create the First Order Date Measure
Start with the plain earliest date. MIN works on dates as well as numbers and text, and on a date column it returns the earliest one.
- Select the Sales table in the Data pane.
- On the Home ribbon, click New measure in the Calculations group.

- Type the formula below in the formula bar and press Enter.
- On Measure tools, set Format to mm/dd/yyyy.
- Drag the measure into the table.
First Order Date = MIN(Sales[OrderDate])

Look at the First Order Date column: each rep gets a different date because the table row filters the Sales table to that rep. The function itself is covered in more depth in the Power BI DAX MIN function guide.
Checkpoint: Brian Keller shows 01/24/2026, Dana Whitfield 02/04/2026, and the Total row 01/12/2026.
Step 2: Get the Value From the Row With the Minimum Date
This is the question most people search for. MIN only returns the date, so we store it in a variable and then filter the table to that date with CALCULATE (the filter replaces the date filter for this one calculation).
Product on First Order Date =
VAR FirstOrderDay = MIN(Sales[OrderDate])
RETURN
CALCULATE(MAX(Sales[Product]), Sales[OrderDate] = FirstOrderDay)

Notice the Format box says Text, because the measure returns a product name. MAX around the Product column is there because CALCULATE needs an aggregate; if two orders shared the first date, MAX would return the alphabetically last product. My data has no ties.
Checkpoint: Marcus Hale shows Surface Laptop 7, and Rachel Morgan shows Visio Plan 2.
Step 3: Sum Sales on the First Order Date
Same variable, different aggregate. Swap MAX(Sales[Product]) for SUM(Sales[Sales]) and set the Format to Currency. For the opposite end of the year, the DAX MAX date tutorial uses MAX the same way.
Sales on First Order Date =
VAR FirstOrderDay = MIN(Sales[OrderDate])
RETURN
CALCULATE(SUM(Sales[Sales]), Sales[OrderDate] = FirstOrderDay)

The Sales on First Order Date column now shows the amount from that first row only, not the rep’s total sales for the year.
Checkpoint: Marcus Hale shows $3,897 and Tyler Brooks shows $49.
Step 4: Count the Days From the First to the Last Order
DATEDIFF returns a positive number when the second date is later. Feed it MIN and MAX of the same column and set the Format to Whole number. The DATEDIFF in Power BI DAX guide lists every interval.
Days Since First Order = DATEDIFF(MIN(Sales[OrderDate]), MAX(Sales[OrderDate]), DAY)

The Total row shows 240, the days between 01/12/2026 and 09/09/2026. To measure up to today instead, replace MAX(Sales[OrderDate]) with TODAY().
Checkpoint: Rachel Morgan shows 240 and Dana Whitfield shows 200.
Test the Table
Here’s the full result from my file. I checked each first-order row against the CSV:
| SalesRep | First Order Date | Product | Sales | Days |
|---|---|---|---|---|
| Brian Keller | 01/24/2026 | Wireless Mouse | $392 | 226 |
| Dana Whitfield | 02/04/2026 | Visio Plan 2 | $360 | 200 |
| Marcus Hale | 01/30/2026 | Surface Laptop 7 | $3,897 | 217 |
| Rachel Morgan | 01/12/2026 | Visio Plan 2 | $1,440 | 240 |
| Tyler Brooks | 01/21/2026 | Wireless Mouse | $49 | 199 |
Every value matches the CSV, so the measures respect the SalesRep row. To lock a MIN measure to one region instead, see the DAX MIN with filter examples.
Troubleshooting
Important: don’t name the variable FirstDate or LastDate. Those are DAX function names, and Power BI rejects them:

All three errors cleared once I renamed the variables to FirstOrderDay and LastOrderDay.
- MIN returns a text value, not a date: OrderDate came in as Text. Change the column type to Date in Power Query, and if US dates won’t convert, check the file’s Locale for import.
- Two rows share the first date: the product measure shows only one of them. Use CONCATENATEX over the filtered rows if you need both.
- Blank result: the visual row has no orders, so MIN has nothing to return.
Where to Take It Next
- Shift the first date back a day, month or year with the DAX MIN date minus examples.
- Find the highest value or latest date with the Power BI DAX MAX function.
- Compare each month to the previous one with a month over month change measure.
If you’re building more date measures, these tutorials help next:
Frequently Asked Questions
How do I get the minimum date in DAX?
Create a measure with MIN on the date column, for example First Order Date = MIN(Sales[OrderDate]), and set its format to a date format such as mm/dd/yyyy.
How do I get a value from the row with the minimum date in Power BI?
Store the minimum date in a variable, then filter to it: VAR FirstOrderDay = MIN(Sales[OrderDate]) RETURN CALCULATE(MAX(Sales[Product]), Sales[OrderDate] = FirstOrderDay). Use SUM instead of MAX for an amount.
Why do I get a reserved word error for my variable?
FirstDate and LastDate are DAX function names, so Power BI reports ‘FirstDate’ is a reserved word. Rename the variable, for example to FirstOrderDay.
What is the difference between MIN and FIRSTDATE?
MIN returns a single scalar date. FIRSTDATE returns a table with a single column and a single row holding the first date in the current context, so it also works where DAX expects a table.
Does MIN work on dates stored as text?
MIN counts text values too, so it returns the smallest text, not the earliest date. Convert the column to Date first. Microsoft lists the value types MIN counts in the MIN function reference.

Hey! I’m Bijay Kumar, founder of SPGuides.com and a Microsoft Business Applications MVP (Power Automate, Power Apps). I launched this site in 2020 because I truly enjoy working with SharePoint, Power Platform, and SharePoint Framework (SPFx), and wanted to share that passion through step-by-step tutorials, guides, and training videos. My mission is to help you learn these technologies so you can utilize SharePoint, enhance productivity, and potentially build business solutions along the way.