Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

iTechGuides is reader-supported. When you buy through links on our site, we may earn an affiliate commission. As an Amazon Associate I earn from qualifying purchases. Learn more

Date.AddMonths shifts a date, datetime, or datetimezone value forward or backward by a number of months. It does not consolidate ledger tables. To combine monthly general ledger (GL) exports in Power Query, you use a folder combine or an Append operation, and you can use Date.AddMonths inside that workflow to derive period dates. This article explains each piece, the order to build them in, and the checks you should run before trusting the combined output.

What Date.AddMonths does

Microsoft documents the syntax as Date.AddMonths(dateTime as any, numberOfMonths as number) as any. It accepts a date, datetime, or datetimezone value, and it returns a value of the same type. The Date.AddMonths reference on Microsoft Learn gives these examples:

Date.AddMonths(#date(2011, 5, 14), 5)
// #date(2011, 10, 14)

Date.AddMonths(#datetime(2011, 5, 14, 8, 15, 22), 18)
// #datetime(2012, 11, 14, 8, 15, 22)

The first example moves May 14 forward five months to October 14. The second moves a datetime forward 18 months and keeps the time of day unchanged. A negative month count moves the value backward.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

What the function does not do

  • It does not read files, merge tables, or remove duplicates.
  • It does not define a fiscal calendar, an accounting period, or a period-close date. If your organization’s period runs from the 26th to the 25th, or uses a 4-4-5 calendar, you must write that rule yourself.
  • It does not confirm that a ledger export is complete or correct.

Treat Date.AddMonths as a tool for labelling rows with a period, not as the step that produces the consolidated ledger.

#1 Best Overall
Sale
Microsoft Excel Laminated Two-Sided Keyboard Shortcut Guide - Windows Edition
  • Over 215 Microsoft Windows Excel Shortcuts
  • Two-Sided Durable Laminiated Sheet
  • Designed for Excel on a Windows Computer

Choose the consolidation method first

Power Query offers three practical routes for combining monthly files or tables. Pick the one that matches where your exports live and how consistent their layouts are.

Approach Use it when How columns are matched Source documentation
Folder combine (Combine and Transform) Monthly files land in one folder and share the same format and structure Power Query applies the transformations from a sample file to every file in the filtered list Folder connector; Combine files overview
Append queries Each month is already a separate query in the workbook or model Matched by column header names, not position; unmatched columns produce nulls Append queries
Table.Combine in M You assemble a list of tables in M code Appends the tables in the list it receives Table.Combine

Folder combine suits a recurring drop folder, because a refresh picks up new files that match your filter. Append suits a fixed set of month queries. Neither approach is universally better; the deciding factors are source organization, schema consistency, and whether each file needs its own cleanup before it joins the others.

Rank #2
Sale
Microsoft Surface Pro Keyboard with Pen Storage, Compatible with Copilot+ (11th Edition), Surface 9 and 8, Alcantara Material, Black
  • Instant Copilot. Unlock new possibilities with the dedicated Copilot key, which gives you instant access to experiences that can enhance your productivity¹.
  • Enhance your experience With the new microphone mute key and snipping key
  • Full keyboard experience. Features a full mechanical keyset, backlit keys, and a large trackpad for precise navigation and control. Optimal key spacing allows fast, fluid typing.
  • Slim and compact Performs like a traditional, full-size keyboard.
  • Clicks in place instantly Use in combination with the Surface Pro (11th Edition), Pro 9 and Pro 8* kickstand for a perfect laptop experience anywhere.

Build a repeatable folder workflow

Keep each month’s export in one dedicated folder, with a consistent file type and column layout. Then follow these steps.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
  1. Connect to the folder. In Power BI Desktop, select Home > Get Data > Folder. In Excel for Windows, select Data > Get Data > From File > From Folder. Enter the folder path and select OK.
  2. Filter the file list. In the preview, filter the Extension column to the file type you expect, and filter Folder Path or Name so that only the intended month’s files remain. Temporary files, archives, and files from other periods should be excluded here, before combining.
  3. Start the combine. Select Combine > Combine and Transform Data. Power Query asks you to choose a sample file and opens a Transform Sample File query.
  4. Put the per-file cleanup in the sample query. Promote headers, remove blank rows, set data types, and rename columns here. Power Query generates a helper function from these steps and applies it to every file in the filtered list.
  5. Add lineage columns. Keep the source file name and the accounting period in the output so that every row can be traced to an input file. Use the Source.Name column that the folder connector provides, and add a period column as described below.
  6. Close and load. Select Home > Close & Load. To pick up next month’s file, add it to the folder and select Refresh.

The combine step assumes every file has the same structure. A file with an extra column, a renamed header, or a different sheet name will not fail cleanly; it will create nulls or misaligned fields downstream. Check the first few files before you rely on the output.

Rank #3
Pixiecube Excel Cheat Sheet Desk Pad | Excel Shortcut Keys Mouse Pad | Extended Large XL Gaming Mousepad | PC Office Spreadsheet Keyboard Mat | Non-Slip Stitched Edge
  • EXCEL SHORTCUTS. ZERO SEARCHING. – Our bestselling reference mat puts an extensive collection of commonly used commands, formulas and helpful tricks directly beneath your fingertips so you can find answers fast, work smarter and stay in the flow.
  • YOUR DESK. SMARTER. – Clearly organized sections for navigation, selection, formatting, data and functions make it easy to find the right Excel command exactly when you need it.
  • LEARN, WORK & RESET – Built-in desk-exercise diagrams give you 10 quick ways to stretch, recharge and return to work feeling sharper.
  • ROOM TO WORK & CREATE – The extended 31.5 x 11.8-inch Pixiecube desk mat fits a laptop or keyboard and mouse, while the soft 2 mm surface adds comfort and protects your desktop.
  • BUILT FOR REAL-WORLD WORKDAYS – A rugged stitched edge helps prevent fraying, and the water-resistant, stain-resistant surface protects against scratches, spills and everyday wear—because smarter desks should work harder.

Derive the period with Date.AddMonths

A common pattern is to store each file’s period start as a date and derive the following month when you need it, for example for an opening-to-closing comparison. Add a custom column with Add Column > Custom Column and use an expression such as:

Date.AddMonths([PeriodStart], 1)

If PeriodStart is a date column, the result is a date. If it is text, convert it first with a type conversion step. Test the expression on month-end dates and on a February in a leap year in your own query, because the result for those dates is what your reporting will use. The documentation shows the arithmetic but does not decide which day your reporting period should use.

Rank #4
Sale
Incase Wired Keyboard 600 – Designed by Microsoft – Spill Resistant, Quiet Touch Keys, Plug and Play, 4 Hotkeys, Windows Start Key – Black
  • Efficient Media Controls: The Wired Keyboard 600, designed by Microsoft, features a Media Center with four hot keys for easy control of play/pause, volume up, volume down, and mute functions.
  • Quiet and Responsive Keys: Enjoy a comfortable typing experience with quiet, thin-profile keys that are both responsive and efficient.
  • Convenient Shortcuts: Quickly access common tasks with dedicated shortcut keys, including a calculator hot key and a Windows start screen key.
  • Spill-Resistant Design: Work confidently with a spill-resistant design that protects your keyboard from accidental messes.
  • Plug-and-Play Simplicity: No software needed—just connect the keyboard to your PC and start using it right away, with a full number pad for efficient data entry.

Append queries that already exist

If each month is already a separate query, select Home > Append Queries, choose the first table, and add the others. Use Append Queries as New when you want to keep the individual month queries unchanged for audit purposes.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

In M, the same result comes from Table.Combine, which takes a list of tables:

Best Value
SYNERLOGIC Microsoft Word/Excel (for Windows) Reference Guide Keyboard Shortcut Sticker, Laminated, No-Residue Vinyl (White/Small)
  • 💻 ✔️ EVERY ESSENTIAL SHORTCUT - With the SYNERLOGIC Reference Keyboard Shortcut Sticker, you have the most important shortcuts conveniently placed right in front of you. Easily learn new shortcuts and always be able to quickly lookup commands without the need to “Google” it.
  • 💻✔️ Work FASTER and SMARTER - Quick tips at your fingertips! This tool makes it easy to learn how to use your computer much faster and makes your workflow increase exponentially. It’s perfect for any age or skill level, students or seniors, at home, or in the office.
  • 💻 ✔️ New adhesive – stronger hold. It may leave a light residue when removed, but this wipes off easily with a soft cloth and warm, soapy water. Fewer air bubbles – for the smoothest finish, don’t peel off the entire backing at once. Instead, fold back a small section, line it up, and press gradually as you peel more. The “peel-and-stick-all-at-once” method only works for thin decals, not for stickers like ours.
  • 💻 ✔️ Compatible and fits any brand laptop or desktop running Windows 10 or 11 Operating System.
  • 💻 ✔️ Original Design and Production by Synerlogic Electronics, San Diego, CA, Boca Raton, FL and Bay City, MI, United States 2020. All rights reserved, any commercial reproduction without permission is punishable by all applicable laws.
let
    Source = Table.Combine({Jan_GL, Feb_GL, Mar_GL})
in
    Source

Before appending, compare the header names and data types of the month queries. Because matching uses names, a header that reads Acct No in one month and Account in another will produce two columns, each partly empty.

Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

Validation before the output is used

Power Query’s documentation describes how the mechanics work. It does not describe accounting controls, so the checks below are prudent steps for you to adopt according to your organization’s accounting policy, not requirements that Microsoft sets.

  • Record counts: compare the row count of each source file, or each month query, with the row count of its rows in the combined output.
  • Coverage: confirm that every expected month and account range appears, and that no period appears twice unless you expect it.
  • Totals: compare the sum of a control column against the total in the source system’s export for the same period.
  • Debits and credits: where your ledger balances, check that debits equal credits for each period in the output.
  • Sign, currency, and approvals: confirm the sign convention, currency fields, and any approval steps against your own accounting procedures.

Troubleshooting common problems

  • Files from another period appear in the output. The folder filter is too broad. Filter on the period in the file name or in the Source.Name column.
  • Columns are full of nulls after an append. A header differs between months. Rename the header in the source query so that the names match exactly.
  • A new file does not appear after refresh. The file is outside the folder path or fails your filter. Check the filter on Extension and Name.
  • The date result is one day off or lands on an unexpected day. The input column is text or a datetime with a time component. Convert it to date before calling Date.AddMonths, and test the result on month-end examples.

Power Query refreshes the query you built; it does not schedule itself. For regular unattended refresh, use the refresh options of the tool you publish to, and confirm them with your IT or BI team.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.