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
| Excel | SUMIFS(amounts,dates,">="&DATE(YEAR(d),1,1),dates,"<="&d) |
|---|---|
| Match |
DATESYTD returns the dates from January 1 to the last date of the context.
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:
“I want the revenue from January 1 to the last date shown.”
Year
2024
2025
| Month Name | Cumulative Revenue |
|---|---|
| January | 200,000 |
| February | 350,000 |
| March | 500,000 |
| April | 500,000 |
| May | 650,000 |
| June | 650,000 |
| July | 800,000 |
| August | 800,000 |
| September | 900,000 |
| October | 900,000 |
| November | 900,000 |
| December | 950,000 |
| Total | 950,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.
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.
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 Date Visitors 1/15/2026 500 2/15/2026 420 3/15/2026 610 Which formula should you write for “Visitors Since January”?
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 Callout Date C-1 12/12/2025 C-2 1/5/2026 C-3 2/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.