16.8A running total since January

The running total since the start of the year is one of the numbers you will be asked for most. DATESYTD makes it simple.

16.8.1DATESYTD

In Excel
ExcelSUMIFS(amounts,dates,">="&DATE(YEAR(d),1,1),dates,"<="&d)
Match

DATESYTD returns the dates from January 1 to the last date of the context.

DATESYTD( <dates>, [<year end date>] )

It expects the date column of the date table, like Calendar[Date]. The second argument is optional. It is used when the accounting year, called the fiscal year, does not start in January. Let us put this measure in a table by month:

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

“I want the revenue from January 1 to the last date shown.”

Year

2024

2025

Table visual, The “Cumulative Revenue” measure by month, in 2025
Month NameCumulative Revenue
January200,000
February350,000
March500,000
April500,000
May650,000
June650,000
July800,000
August800,000
September900,000
October900,000
November900,000
December950,000
Total950,000

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

Each month adds its sales to the previous ones. April has no sales, and the running total stays at 500,000. The running total starts again from zero every January 1, because DATESYTD always starts from January 1 of the year of the last date. On the January 2025 row, it only gives CALCULATE the days of January 2025.

Tips
  • TOTALYTD( [Revenue], Calendar[Date] ) gives the same result, in a single function.

  • For a fiscal year that does not start in January, DATESYTD accepts a year end date as its second argument, like "6/30" for a fiscal year that ends on June 30.

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 museum already has a “Visitors” measure, the sum of the “Visitors” column of the “Admissions” table. The “Days” date table, with its “Date” column, is marked and linked to “Admissions.” In a visual by month, write the “Visitors Since January” measure, from January 1 to the last date of the row.

    Admissions
    DateVisitors
    1/15/2026500
    2/15/2026420
    3/15/2026610

    Which formula should you write for “Visitors Since January”?

  2. Combined useMeasureDifficulty

    A fire station records each callout on a row of the “Callouts” table. The “Callouts” measure counts these rows. The “Days” date table, with its “Date” column, is marked and linked to “Callouts.” In a visual by month, write the “Monthly Average Since January” measure, the average number of callouts per month, from January 1 to the month of the row.

    Callouts
    CalloutDate
    C-112/12/2025
    C-21/5/2026
    C-32/18/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.