To get the year from a date in Power Query, select the date column, then use Transform > Date > Year (or Add Column > Date > Year to keep the original). This extracts the four-digit year as a number. If you need a text year or a year from a text date, use Date.Year or Date.FromText in a custom column. The steps below cover Excel and Power BI Desktop, where the Power Query Editor is nearly identical; menu labels can differ slightly by version and region.

What You'll Need

  • Excel (Power Query is built into Excel for Windows and Mac) or Power BI Desktop.
  • A table with a column that contains real date values, not text that looks like a date.
  • Basic familiarity with the Power Query Editor window.

Step-by-Step

  1. Load your data into Power Query: in Excel, select your table and go to Data > From Table/Range; in Power BI Desktop, use Home > Transform data to open the Power Query Editor.
  2. In the Power Query Editor, click the header of the date column to select it. The column should show a date icon (a small calendar) in the header; if it shows ABC or a number icon, the column is not typed as a date yet.
  3. If the column is not a date, convert it first: with the column selected, go to Transform > Data Type and choose Date. If a dialog appears about replacing the current step, choose Replace Current (or Add New Step if you want to keep the original conversion).
  4. To replace the date column with the year: keep the column selected and go to Transform > Date > Year. The column now contains the four-digit year as a number.
  5. To keep the original date and add a year column: select the column and go to Add Column > Date > Year. A new column named something like "Year" is added to the right.
  6. Rename the new column if needed: double-click its header, type a name such as Year, and press Enter.
  7. Check the data type of the year column: select it and confirm Transform > Data Type shows Whole Number. If it shows Text, change it to Whole Number so sorting and calculations work correctly.
  8. Apply the changes: go to Home > Close & Load (Excel) or Home > Close & Apply (Power BI Desktop) to load the result back into your workbook or model.

Common Mistakes

  • Extracting from a text column. If the date column is typed as Text, Transform > Date > Year may be greyed out or produce an error. Convert the data type to Date first.
  • Using the wrong locale. Text dates like 03/04/2025 are ambiguous. When converting, use Transform > Data Type > Using Locale and pick the correct locale so day and month are read correctly.
  • Expecting a text year. The Year transform returns a number, not text.
  • Forgetting to refresh. After changing the query, existing PivotTables or visuals may need a refresh to show the new year column.
  • Assuming the column updates automatically. If new rows are added to the source table, refresh the query; the year column is recalculated only on refresh.

Tips

  • Use Add Column > Date > Year instead of Transform when you may need the original date later for other calculations.
  • For a year from a text date in a custom column, use Date.Year(Date.FromText([ColumnName], "en-US")) and adjust the locale string to match your data.
  • If your dates include times, the Year transform still works; it ignores the time portion.
  • Name your steps clearly in the Applied Steps pane so you can trace where the year column came from.
  • To extract year, quarter, month, and day at once, use Add Column > Date > Year, then repeat for Quarter, Month, and Day.

Troubleshooting

  • Year option is greyed out: the column is not typed as Date. Change the data type to Date first, then retry.
  • Error values appear: some rows contain text or invalid dates. Filter out errors or clean the source values, then reapply the step.
  • Wrong year (for example, 2024 instead of 2025): check the locale used when converting text to date, and confirm the source data itself is correct.
  • Column shows decimals: the data type is Decimal Number. Change it to Whole Number.
  • Changes do not appear in the worksheet or report: use Home > Refresh (or Refresh All in Excel) to reload the query results.
  • Custom column formula errors: confirm the column name in the formula matches exactly, including spaces and capitalization, and that the column is a date type.

Frequently Asked Questions

Can I get the year without changing the original date column?

Yes. Use Add Column > Date > Year instead of Transform > Date > Year. The original date column stays intact and a new year column is added.

Why does my year column show as text?

The Year transform returns a number by default, but if the source column was text or the step was edited, the result may be typed as text. Select the column and set Data Type to Whole Number.

How do I extract the year from a text date like "2025-03-15"?

Add a custom column with Date.Year(Date.FromText([ColumnName], "en-US")). Adjust the locale string if your dates use a different format.

Does this work in both Excel and Power BI?

Yes. The Power Query Editor is shared between Excel and Power BI Desktop, so the Transform > Date > Year and Add Column > Date > Year commands work the same way. Menu wording may vary slightly by version.

Can I get the year as a two-digit value?

Not with a single built-in button.

Will the year update automatically when new data arrives?

The year is recalculated when the query refreshes. Refresh the query after adding or changing source rows to update the year column.