16.4Neighboring periods
PREVIOUSMONTH looks back. Sometimes you will want to look ahead, or to jump several periods at once. Other functions do that.
16.4.1NEXTMONTH and its neighbors
You need it when you want, next to each month, the number of the following month.
NEXTMONTH returns all the days of the following month, starting from the last date of the context.
It expects a single argument, the date column of the date table, here Calendar[Date]. Let us put this measure in a table by month:
“I want the revenue, moving forward one whole month.”
On the February 2025 row, the last date is 2/28/2025. NEXTMONTH returns the days of March 2025, and the measure returns 150,000, sale V008.
Year
2024
2025
| Month Name | Revenue Next Month |
|---|---|
| January | 150,000 |
| February | 150,000 |
| April | 150,000 |
| June | 150,000 |
| August | 100,000 |
| November | 50,000 |
| Total |
This is a reproduction of the Power BI interface for teaching purposes. It differs from the real interface.
The “Total” row starts from 12/31/2025. The calendar stops at that date. NEXTMONTH finds no day of January 2026, and the row stays blank. This blank does not point to any error in your formula.
NEXTDAY, NEXTQUARTER and NEXTYEAR follow the same pattern. On the 2024 row, CALCULATE( [Revenue], NEXTYEAR( Calendar[Date] ) ) returns the whole year 2025, 950,000.
The PREVIOUS functions start from the first date of the context, the NEXT functions from the last one.
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 travel agency already has a “Travelers” measure, the sum of the “Travelers” column of the “Departures” table. The “Days” date table, with its “Date” column, is marked and linked to “Departures.” In a visual by month, write the “Travelers Next Month” measure, which takes the whole following month.
Departures Date Travelers 6/12/2026 40 7/3/2026 50 7/25/2026 35 Which formula should you write for “Travelers Next Month”?
Combined useMeasureDifficulty
The agency wants to know by how much the number of travelers changes from one month to the next. The “Travelers” measure adds up the “Travelers” column of the “Departures” table. The “Days” date table, with its “Date” column, is marked and linked to “Departures.” In a visual by month, write the “Increase Next Month” measure.
Departures Date Travelers 6/12/2026 40 7/3/2026 50 7/25/2026 35 Direct useMeasureDifficulty
A hotel already has an “Arrivals” measure, the sum of the “Guests” column of the “Arrivals” table. The “Days” date table, with its “Date” column, is marked and linked to “Arrivals.” In a visual by day, write the “Arrivals Next Day” measure, to prepare the rooms the day before.
Arrivals Date Guests 8/14/2026 12 8/15/2026 18 8/16/2026 9 Combined useMeasureDifficulty
The hotel wants to know, each day, how many times more guests will arrive the next day. The “Arrivals” measure adds up the “Guests” column of the “Arrivals” table. The “Days” date table, with its “Date” column, is marked and linked to “Arrivals.” In a visual by day, write the “Ratio to Next Day” measure, with DIVIDE.
Arrivals Date Guests 8/14/2026 12 8/15/2026 18 8/16/2026 9 Direct useMeasureDifficulty
A language school already has a “Students” measure, the sum of the “Students” column of the “Enrollments” table. The “Days” date table, with its “Date” column, is marked and linked to “Enrollments.” In a visual by month, write the “Students Next Quarter” measure, which takes the whole following quarter.
Enrollments Date Students 5/11/2026 15 7/6/2026 50 9/14/2026 40 Combined useMeasureDifficulty
The school wants to know whether the following quarter attracts more students than the month of the row. The “Students” measure adds up the “Students” column of the “Enrollments” table. The “Days” date table, with its “Date” column, is marked and linked to “Enrollments.” In a visual by month, write the “Trend” measure, which shows “Up” or “Down.”
Enrollments Date Students 5/11/2026 15 7/6/2026 50 9/14/2026 40 Direct useMeasureDifficulty
A wine estate records its harvests in the “Harvests” table. The “Days” date table, with its “Date” column, is marked and linked to “Harvests.” No measure exists yet. In a visual by year, write the “Bottles Next Year” measure, the sum of the “Bottles” column over the whole following year.
Harvests Date Bottles 9/20/2024 900 9/18/2025 1100 10/25/2025 300 Combined useMeasureDifficulty
The estate wants to know by how much its harvest changes from one year to the next. The “Days” date table, with its “Date” column, is marked and linked to “Harvests.” No measure exists yet. In a visual by year, write the “Change to Next Year” measure, from the “Bottles” column.
Harvests Date Bottles 9/20/2024 900 9/18/2025 1100 10/25/2025 300
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.