Live training: next batches coming soon. Join the waitlist:Waitlists open:Developer Training →Developer →Copilot Studio Training →Copilot Studio →

DAX MIN Date in Power BI: Find the First Date and the Value on That Row

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:

Power BI table by sales rep showing first order date, product, sales and days since the first order

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:

OrderIDOrderDateRegionProductSalesRepSales
SO-102001/12/2026WestVisio Plan 2Rachel Morgan$1,440
SO-102701/18/2026EastThinkPad X1Rachel Morgan$8,694
SO-101401/21/2026EastWireless MouseTyler Brooks$49
SO-104701/24/2026EastWireless MouseBrian Keller$392
SO-101001/30/2026SouthSurface Laptop 7Marcus Hale$3,897
SO-104202/04/2026EastVisio Plan 2Dana 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.

  1. Select the Sales table in the Data pane.
  2. On the Home ribbon, click New measure in the Calculations group.
Power BI Desktop Home ribbon with the New measure button in the Calculations group
  1. Type the formula below in the formula bar and press Enter.
  2. On Measure tools, set Format to mm/dd/yyyy.
  3. Drag the measure into the table.
First Order Date = MIN(Sales[OrderDate])
First Order Date measure using MIN on the OrderDate column with mm/dd/yyyy format

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)
DAX measure that returns the product from the row with the minimum order date using VAR and CALCULATE

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)
Sales on First Order Date measure summing sales only for the earliest order date with Currency format

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)
Days Since First Order measure using DATEDIFF between MIN and MAX order dates with Whole number format

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:

SalesRepFirst Order DateProductSalesDays
Brian Keller01/24/2026Wireless Mouse$392226
Dana Whitfield02/04/2026Visio Plan 2$360200
Marcus Hale01/30/2026Surface Laptop 7$3,897217
Rachel Morgan01/12/2026Visio Plan 2$1,440240
Tyler Brooks01/21/2026Wireless Mouse$49199

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:

Power BI TMDL view Problems pane showing FirstDate is a reserved word errors

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

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.