Smart Systems for Home

Plain how-to guides for smart home, security and home Wi-Fi

Power Query Today's Date: How to Add It to Your Data

· 5 min read · Home Tech

In this article
  1. What You'll Need
  2. Step-by-Step
  3. Common Mistakes
  4. Tips
  5. Troubleshooting
  6. Frequently Asked Questions

Adding today’s date in Power Query is a common requirement when preparing reports, logs, or automated data extracts. It ensures your data always reflects the current day without manual updates. This is achieved using Power Query’s built-in date functions, no external tools or add-ins needed. You only need Microsoft Excel (2016 or later) or Microsoft Power BI Desktop installed.

What You'll Need

  • Microsoft Excel 2016 or later (including Microsoft 365)
  • Or Microsoft Power BI Desktop (free download)
  • A data source already loaded into Power Query (Excel table, CSV, database, etc.)
  • Basic familiarity with the Power Query Editor interface

Step-by-Step

  1. Open your Excel workbook or Power BI Desktop file containing the data you want to modify.
  2. Select any cell within your data table or dataset, then go to the Data tab and click Get Data > From Table/Range (in Excel) or Transform Data (in Power BI). This opens the Power Query Editor.
  3. In the Power Query Editor, locate the Add Column tab in the ribbon at the top.
  4. Click Custom Column in the Add Column tab. A dialog box will appear.
  5. In the New column name field, type a clear name like Today's Date or ExtractDate.
  6. In the Custom column formula field, type: DateTime.Date(DateTime.LocalNow()). Do not include quotes or extra spaces.
  7. Click OK. A new column will appear in your table with today’s date in YYYY-MM-DD format.
  8. Optionally, right-click the new column header and select Change Type > Date to confirm the data type.
  9. Click Close & Load (in Excel) or Close & Apply (in Power BI) to return to your worksheet or report.
  10. Verify the new column appears in your output with the correct date. Each time you refresh the query, this column will update automatically to today’s date.

Common Mistakes

  • Typing Today() — this function does not exist in Power Query M language. Use DateTime.LocalNow() instead.
  • Forgetting to use DateTime.Date() around DateTime.LocalNow() — without it, you’ll get both date and time (e.g., 2024-06-15 14:30:22), which may clutter your output or cause formatting issues.
  • Using hardcoded dates like "2024-06-15" — this defeats the purpose of automation and will require manual updates daily.
  • Adding the column before filtering or transforming data — if you add the date column too early, it may be removed unintentionally during later steps. Add it after your main transformations but before final loading.
  • Accidentally changing the column’s data type to Text — if you do, the date will no longer update correctly on refresh. Always confirm the column type is Date.

Tips

  • Use DateTime.Date(DateTime.LocalNow()) for local time zone accuracy. If your data is global and needs UTC, use DateTime.Date(DateTime.UtcNow()).
  • Combine today’s date with other columns using Date.ToText(DateTime.Date(DateTime.LocalNow()), "MM/dd/yyyy") if you need a specific text format for display purposes.
  • For audit trails, consider adding a time column too: DateTime.LocalNow() without the Date() wrapper will include hours and minutes.
  • Use the column to filter data dynamically — for example, only show records from today by applying a filter where Today's Date equals the value in your new column.
  • Test your query by changing your system date temporarily (in Windows Settings > Time & Language) to confirm the function updates correctly.
  • Use descriptive names like Report Run Date instead of Date1 to improve clarity for others reviewing your workbook.

Troubleshooting

  • The column shows #ERROR — check your formula for typos. Ensure you typed DateTime.Date(DateTime.LocalNow()) exactly. Missing parentheses or capitalization errors cause this.
  • The date doesn’t update on refresh — verify you didn’t convert the column to Text. Right-click the column, choose Change Type, and select Date. Also confirm your query is set to refresh automatically under Data > Queries & Connections > Right-click query > Properties > Enable refresh.
  • Power Query won’t open — ensure your data is formatted as a table (Ctrl+T in Excel). If using a range, highlight the data range first before clicking Get Data.
  • Unexpected time zone — if your date appears one day off, your system time zone may be misconfigured. Check Windows Settings > Time & Language > Date & Time > Time zone. Power Query uses your system’s local time.
  • Column disappears after refresh — this usually means your source data structure changed (e.g., columns renamed or removed). Re-run the query with the original source, then re-add the custom column.
  • Getting "Expression.Error" — this is often due to a reference to a non-existent column. Double-check that your formula doesn’t accidentally reference a column name that was renamed or deleted.

Frequently Asked Questions

Can I use today’s date in a filter to show only today’s records?

Yes. After adding the today’s date column, click the filter arrow on your date column, select Date Filters > Equals, then choose the Today's Date column as the value. This dynamically filters to only show matching records.

Why does Power Query show the time when I only want the date?

Because DateTime.LocalNow() returns both date and time. Wrap it with DateTime.Date() to extract only the date portion. Without it, the time component remains visible.

Does this work with Excel Online or mobile Excel?

Yes, but only if you’re using the full Excel app on Windows or Mac. Excel Online and mobile apps do not support Power Query editing. You can view results, but you must edit the query on desktop.

Can I add today’s date to multiple tables at once?

Yes. Repeat the custom column step in each query. Alternatively, create a separate query that returns just today’s date, then merge it into other queries using a join. This keeps the logic centralized.

Will this work if my data source is a SharePoint list or SQL database?

Yes. Power Query’s DateTime.LocalNow() function runs on your local machine during query refresh, regardless of the source. The date is calculated locally and added to the result set.

Is today’s date calculated every time I open the file?

No. It’s calculated only when the query refreshes — either manually (Data > Refresh) or automatically (if enabled). Opening the file doesn’t trigger a refresh. To force an update, press Ctrl+Alt+F5 or click Refresh All.