Smart Systems for Home

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

Power Query Date.IsInCurrentDay: How to Use It

· 6 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

Date.IsInCurrentDay is a Power Query M function that returns true if a given date or datetime value falls on today's date according to your system clock. It is most often used to filter a table so only records from the current day are loaded, for example a daily sales log or a live activity feed. To use it, you need Power Query in Excel or Power BI, a column of type Date, DateTime, or DateTimeZone, and a basic understanding of how to add a custom column or apply a filter with a custom formula.

What You'll Need

  • Power Query Editor open in Excel (Data > Get & Transform Data) or Power BI Desktop (Transform Data). Menu labels can differ slightly by version, device, or region.
  • A query with at least one column that contains date or datetime values. If the column is currently text, convert it to Date or DateTime first.
  • Basic familiarity with adding a custom column or editing a filter formula.

Step-by-Step

  1. Open the Power Query Editor. In Excel, go to the Data tab and choose Get & Transform Data > Launch Power Query Editor. In Power BI Desktop, choose Transform Data on the Home ribbon. The exact wording may vary slightly between versions.
  2. Load or select your table. In the Queries pane on the left, click the query that contains your date column. If you have not loaded data yet, use Data > Get Data to connect to your source first.
  3. Check the column data type. Find the date column in the preview. The icon to the left of the column header should show a calendar (Date) or calendar with a clock (DateTime or DateTimeZone). If it shows ABC (text), click the icon and choose Date or DateTime. If the values are text like "2024-01-15", Power Query usually converts them correctly; if not, use Transform > Data Type and then replace errors.
  4. Add a custom column. Go to Add Column > Custom Column. In the New column name box, type a name such as IsToday. In the Custom column formula box, enter the formula that references your date column. For a column named OrderDate, the formula is:
    Date.IsInCurrentDay([OrderDate])
    If your column is DateTime or DateTimeZone, the same call works because the function accepts those types as well. Click OK.
  5. Review the result. The new column should show true for rows whose date matches today and false for all others. If every row shows false, check that the column really is a date type and that your system date is correct.
  6. Filter to keep only today's rows (optional). Click the filter arrow on the new IsToday column, clear the list, and tick only true. Click OK. Your table now contains only records from the current day.
  7. Alternative: filter directly with a custom formula. Instead of adding a column, you can filter the date column itself. Click the filter arrow on the date column, choose Date Filters > Custom Filter (the exact label varies), and enter a formula such as Date.IsInCurrentDay([OrderDate]). This keeps the query cleaner but is less visible to other users.
  8. Apply and close. Click Home > Close & Load (Excel) or Home > Close & Apply (Power BI) to load the filtered result. The filter is evaluated when the query refreshes, so the data will update to the new current day on each refresh.

Common Mistakes

  • Using a text column. Date.IsInCurrentDay expects a date, datetime, or datetimezone value. Passing text returns an error or false. Convert the column type first.
  • Forgetting the square brackets. In a custom column formula, column references must be written as [ColumnName]. Writing just the column name causes a syntax error.
  • Expecting a static result. The function compares against the current date at refresh time. A query that showed true yesterday will show false today unless the underlying data also changed. This is normal behavior, not a bug.
  • Using it on a column with time zone offsets without checking. DateTimeZone values are compared using the local date part of the value. If your data is stored in UTC but your report is for a different time zone, the day boundary may not match what you expect.
  • Assuming it works in Power Pivot or DAX. Date.IsInCurrentDay is a Power Query M function, not a DAX function. In DAX the equivalent is TODAY() combined with a date column comparison.

Tips

  • Name the helper column clearly, such as IsToday or CurrentDayFlag, so other users understand why rows disappear after a refresh.
  • If you need "yesterday" or "this week", Power Query has related functions: Date.IsInPreviousDay, Date.IsInCurrentWeek, Date.IsInCurrentMonth, and Date.IsInCurrentYear. They follow the same pattern.
  • To keep a fixed snapshot instead of a rolling filter, remove the step after you have filtered, or load the filtered table to a static table. Otherwise the result changes on every refresh.
  • Test the formula on a small sample first. Add the custom column, check a few known dates, then apply the filter.
  • If your source is a database, consider filtering at the source with a native query for better performance on large tables.

Troubleshooting

If the new column shows errors, click the error cell to read the message. "We cannot convert the value to type Date" means the column type is wrong; change it to Date or DateTime. "The name 'Date.IsInCurrentDay' wasn't recognized" usually means a typo or that you are in the wrong formula context, such as a DAX measure rather than a Power Query custom column. If all rows return false, confirm that your system clock and time zone are correct and that the date values are real dates, not text that looks like dates. If the filter removes everything, temporarily remove the filter step and inspect the helper column to see which rows are true. If the query is slow, move the filter earlier in the step list so fewer rows are processed downstream. If the refresh fails after changing the formula, use Home > Advanced Editor to inspect the step and correct the syntax; deleting the step and re-adding it is often faster than debugging a long formula. If results differ between machines, check that each machine's regional date settings and time zone are consistent, because the function uses the local system date.

Frequently Asked Questions

Does Date.IsInCurrentDay work with DateTime columns?

Yes. The function accepts Date, DateTime, and DateTimeZone values. For a DateTime value, only the date portion is considered.

Why does my filter show no rows today?

Either the source data has no records for today's date, or the column is stored as text and the comparison fails. Check the column type and the helper column values.

Can I use this function in a calculated column in Power BI?

No. It is a Power Query M function. In DAX, use TODAY() and compare it to your date column instead.

Does the result update automatically?

It updates when the query refreshes, not continuously. In Excel, refresh with Data > Refresh All; in Power BI, use Refresh on the Home ribbon.

What is the difference between Date.IsInCurrentDay and DateTime.IsInCurrentDay?

Date.IsInCurrentDay is the general function that handles date, datetime, and datetimezone inputs. DateTime.IsInCurrentDay is a more specific variant; for most filtering tasks either works, but Date.IsInCurrentDay is the safer general choice.

Can I filter for a specific date instead of today?

Yes. Use a direct comparison such as [OrderDate] = #date(2024, 1, 15) in a custom filter, or use Date.IsInCurrentDay only when you specifically want the rolling current day.