16.7Month-to-date or quarter-to-date

How much have you sold since the start of the quarter? A function returns the days that run from the first day of the period to the last date of the row.

16.7.1DATESQTD and DATESMTD

In Excel
DAXDATESQTDDATESMTD
ExcelSUMIFS, from the start of the quarter up to the dateSUMIFS, from the start of the month up to the date
Match

You need them to follow a number since the start of the quarter or the month, like the revenue of the quarter up to the last date of the row.

DATESQTD returns the days since the start of the quarter, up to the last date of the context. DATESMTD starts from the start of the month.

DATESQTD( <dates> )
DATESMTD( <dates> )

Each one expects a single argument, the date column of the date table, here Calendar[Date]. Let us put this measure in a table by month:

Quarter-to-Date Revenue = CALCULATE( [Revenue], DATESQTD( Calendar[Date] ) )
Power BI accepts this DAX foryes, Measureyes, Calculated columnno, Calculated tableno, Virtual table
In plain words

“I want the revenue from the start of the quarter to the last date shown.”

  • On the January 2025 row, it keeps January, 200,000.
  • On the February 2025 row, it keeps January and February, 350,000.
  • On the March 2025 row, the whole quarter, 500,000.
  • On the May 2025 row, a new quarter begins. It keeps April and May, 150,000.

Month

January 2025

February 2025

March 2025

April 2025

May 2025

June 2025

Table visual, The “Quarter-to-Date Revenue” measure by month
Month NameQuarter-to-Date Revenue
January 2025200,000
February 2025350,000
March 2025500,000
May 2025150,000
June 2025150,000
Total150,000

This is a reproduction of the Power BI interface for teaching purposes. It differs from the real interface.

April has no sales, and its row disappears. The “Total” row starts from 6/30/2025, and keeps April, May and June, 150,000. The total therefore does not add up the rows of the visual, and that is not an error.

Tip

DATESMTD follows the same pattern, from the first day of the month. It is mostly useful in a visual by day, because in a visual by month it gives back the number of the whole month.

Practice

Each exercise is solved with the function you just discovered. Two exercises per function, a direct use and a combined use, from easiest to hardest, on data other than the course data. Pick the right formula out of five.

  1. Direct useMeasureDifficulty

    A farm already has a “Liters” measure, the sum of the “Liters” column of the “Milking” table. The “Days” date table, with its “Date” column, is marked and linked to “Milking.” In a visual by month, write the “Liters Quarter to Date” measure, from the first day of the quarter to the last date of the row.

    Milking
    DateLiters
    7/15/2026400
    8/15/2026350
    9/15/2026420

    Which formula should you write for “Liters Quarter to Date”?

  2. Combined useMeasureDifficulty

    A garage records each repair on a row of the “Repairs” table. The “Repairs” measure counts these rows. The “Days” date table, with its “Date” column, is marked and linked to “Repairs.” In a visual by month, write the “Month Share of Quarter” measure, the share of the repairs of the month among those of the quarter so far.

    Repairs
    VehicleDate
    V-10112/15/2025
    V-1021/8/2026
    V-1032/20/2026
  3. Direct useMeasureDifficulty

    A pastry shop records its croissants each day in the “Production” table. The “Days” date table, with its “Date” column, is marked and linked to “Production.” No measure exists yet. In a visual by day, write the “Croissants Month to Date” measure, the sum of the “Croissants” column since the first day of the month. DATESMTD is used like DATESQTD.

    Production
    DateCroissants
    4/1/202680
    4/2/202695
    4/3/202670
  4. Combined useMeasureDifficulty

    The pastry shop records each batch on a row of the “Batches” table. The “Batches” measure counts these rows. The “Days” date table, with its “Date” column, is marked and linked to “Batches.” In a visual by day, write the “Batches on Earlier Days” measure, the number of batches made since the start of the month, without counting those of the day of the row.

    Batches
    BatchDate
    B13/31/2026
    B24/1/2026
    B34/2/2026
    B44/2/2026

The rest of this lesson is part of izyDAX Pro

You have just read the first section. The next one, its animations, the exercises and the summary are waiting for you with izyDAX Pro, in a single payment.