PREVIOUSMONTH
The dates of the month before the first date in the filter context.
Group: Time intelligence. Compatible with DAX.
Syntax
PREVIOUSMONTH ( <dates> )
| Parameter | Type | Description |
|---|---|---|
dates | Dates | A column of dates of the model, such as Sales[Month], or the name of a calendar defined in the model. |
Returns
Table. The dates the column holds in the month before the first date in the filter context.
Remarks
- The whole previous month comes back, whatever part of the current month is selected; with a selection over several months, the month before the first.
- Only dates the column holds come back: a date the move or the period lands on that the column lacks is left out, and when none is left the table is empty.
- Given a column, it reads the dates visible in the current filter context; in a row context, such as
ADDCOLUMNS, the row becomes a filter first, so each row sees its own dates. - Given a calendar instead of a column, it works on the calendar's own periods (fiscal years, retail months of four or five weeks, ISO weeks). A filter on a category the calendar does not define, such as a month on a calendar of weeks, can make the call an error.
Examples
Change against the month before
EVALUATE
ADDCOLUMNS (
DATESBETWEEN ( Sales[Month], DATE ( 2025, 2, 1 ), DATE ( 2025, 5, 1 ) ),
"Liters", [Liters sold],
"Change", [Liters sold] - CALCULATE ( [Liters sold], PREVIOUSMONTH ( Sales[Month] ) )
)
ORDER BY Sales[Month]
| Sales[Month] | Liters | Change |
|---|---|---|
| 2025-02-01 | 44831 | 196 |
| 2025-03-01 | 43593 | -1238 |
| 2025-04-01 | 44318 | 725 |
| 2025-05-01 | 49448 | 5130 |
The dates it returns
On Sales[Month] each month is a single date, its first.
EVALUATE
CALCULATETABLE (
PREVIOUSMONTH ( Sales[Month] ),
Sales[Month] = DATE ( 2025, 3, 1 )
)
| Sales[Month] |
|---|
| 2025-02-01 |