DateTime.IsInNextMinute is a Power Query M function that indicates whether the provided date(time) value occurs during the next minute. The function returns true if the value occurs in the next minute, otherwise false.
Compatible with: Power BI Service Power BI Desktop Excel Microsoft 365
Syntax
DateTime.IsInNextMinute( dateTime as any ) as nullable logical
Description
DateTime.IsInNextMinute indicates whether the given dateTime argument (which can be of type datetime or datetimezone) occurs during the next minute, as determined by the current date and time on the system. This function will return false for a value within the current minute.
Examples
Let’s explore two examples to understand how the DateTime.IsInNextMinute function works.
Checking DateTime Values for the Next Minute
Imagine you have a table with DateTime values and you want to add a column that shows true for DateTime values that fall within the next minute. You can do this by using the DateTime.IsInNextMinute function on your [DateTime] column.
DateTime.IsInNextMinute( [DateTime] ) // Output depends on [DateTime] column
This expression returns true for any DateTime values in the [DateTime] column that fall within the next minute.
If the current time is 10:20:50 PM on July 7, 2024, this function will return true for all rows with DateTime values between 10:21:00 PM and 10:21:59 PM. Here’s a screenshot that shows how this function can be used on a datetime table that increments with 1 minute each row:

As the image shows, there is one value that falls within the next minute.
Using the Current Date and Time
If you want to check with DateTime.IsInNextMinute if the current date and time falls within the next minute, you can do that using the DateTime.FixedLocalNow function and adding one minute using the #duration function:
// Output: true
DateTime.IsInNextMinute(
DateTime.FixedLocalNow() + #duration(0, 0, 1, 0)
)
Related functions
Other functions related to DateTime.IsInNextMinute are:
- DateTime.IsInNextHour
- DateTime.IsInNextNHours
- DateTime.IsInNextNMinutes
- DateTime.IsInNextNSeconds
- DateTime.IsInNextSecond
2023-2026 © BI Gorilla. All rights are reserved. Information from Microsoft docs is property of Microsoft Corp. | Privacy Policy