<!-- https://learnsql.cpetoday.com/functions/dax/month -->
# MONTH

Language: DAX
Category: Date and time
Syntax: MONTH(<date>)
Summary: Returns the month number of a date, from 1 for January to 12 for December.
Returns: A whole number from 1 to 12.
Level: Beginner
Related: YEAR, DAY, QUARTER, EOMONTH, DATE

## What it does
MONTH reads the month number out of a date. It is the usual building block for month labels, for sort keys that put months in the right order, and for fiscal month numbers. Text month names such as "October" sort alphabetically, so a numeric month or a year-month key is needed for charts and tables to show months in order.

## Syntax and arguments
- date: any date or datetime value. Required.

## Example
A company has a June 30 year end, so its first fiscal month is July. The controller wants a fiscal month number where July is 1 and June is 12, so the fiscal year sorts correctly in a report.

```dax
Fiscal Month =
MOD(MONTH('Calendar'[Date]) - 7, 12) + 1
```

For July the formula gives 1. For June it gives 12. MOD with a negative number returns a positive result in DAX, so the months from January to June wrap around to the end of the fiscal year. Sort the month name column by this number so the months appear in fiscal order.

## Example: a second, different use
A year-month key of the form 202610 sorts correctly in every report and works as the sort column for a month name.

```dax
Year Month Key = YEAR('Calendar'[Date]) * 100 + MONTH('Calendar'[Date])
```

October 2026 becomes 202610 and January 2027 becomes 202701, so the keys sort in time order.

## Things to watch
- A month number alone does not identify a period. January 2026 and January 2027 both return 1, so pair it with the year.
- The month number is a number. Sort the month name column by it, or the report will show months alphabetically.
- MONTH on a blank returns a blank. Check for blank dates in fact tables.
- Fiscal months need the fiscal offset. Do not hard code the offset in many measures. Put the fiscal month in a Calendar column.

## In business terms
MONTH drives the month-end pack, monthly trend charts, fiscal month reporting and the seasonality analysis used in budgets and forecasts. Month order errors are among the most common mistakes in finance dashboards, so a numeric month key is a standard part of a date table.
