<!-- https://learnsql.cpetoday.com/functions/dax/previousmonth -->
# PREVIOUSMONTH

Language: DAX
Category: Time intelligence: shift and compare
Syntax: PREVIOUSMONTH(<dates>)
Summary: Returns all the dates of the month before the first date in the filter context.
Returns: A table of dates.
Level: Intermediate
Related: PREVIOUSQUARTER, PREVIOUSYEAR, DATEADD, PARALLELPERIOD, NEXTMONTH

## What it does
PREVIOUSMONTH returns every date in the month before the one in context. Inside CALCULATE, a measure shows the whole of last month's figure, whatever part of the current month is visible. Finance teams use it for month-over-month growth, for the prior month's accruals that reverse in the current month, and for last month's expenses in a variance review.

## Syntax and arguments
- dates: the date column of the Calendar table. Required.

## Example
A monthly sales report compares each month with the month before. The measure returns the full prior month, so a row for October shows all of September.

```dax
Revenue Last Month = CALCULATE([Total Revenue], PREVIOUSMONTH('Calendar'[Date]))

Revenue MoM % = DIVIDE([Total Revenue] - [Revenue Last Month], [Revenue Last Month])
```

In the October 2026 row, Revenue Last Month adds up every day of September 2026. The growth rate compares the two full months.

## Example: a second, different use
Accruals booked at the end of last month that reverse in the current month. The reversal amount is the total of last month's accruals.

```dax
Accrual Reversal This Month =
CALCULATE(
    SUM('Accruals'[Amount]),
    PREVIOUSMONTH('Calendar'[Date]),
    'Accruals'[Status] = "Open"
)
```

## Things to watch
- PREVIOUSMONTH returns the full prior month even when the current view is a partial month. That makes it different from DATEADD.
- It uses calendar months. A fiscal month needs a filter on the fiscal columns.
- It is a flow measure. For a balance such as cash or inventory, use CLOSINGBALANCEMONTH, because the balance at the end of last month is not the sum of last month's rows.
- The Calendar must have no gaps.

## In business terms
PREVIOUSMONTH supports month-over-month sales reviews, accrual reversal checks at the start of the close, and the prior month variance commentary that controllers give to management. It answers "what happened last month?" in one line.
