Date.IsInNextNQuarters

Updated on

Date.IsInNextNQuarters is a Power Query M function that indicates whether the given date(time) value occurs during the next number of quarters, as determined by the system. The function returns a boolean value (true or false).

Compatible with: Power BI Service Power BI Desktop Excel Microsoft 365

Syntax

Date.IsInNextNQuarters(
   dateTime as any,
   quarters as number,
) as nullable logical

Description

Date.IsInNextNQuarters evaluates whether the dateTime argument (of type date, datetime, or datetimezone) is within the next specified number of quarters from the current date and time, excluding the current quarter. It includes a quarters argument that specifies the number of quarters.

Examples

Determine if the quarter after the current system time is in the next two quarters.

// Output: true
Date.IsInNextNQuarters( Date.AddQuarters( DateTime.FixedLocalNow(), 1 ), 2 )

Other functions related to Date.IsInNextNQuarters are:

BI Gorilla Youtube Channel

Contribute » | Contributors: Rick de Groot
Microsoft documentation: https://learn.microsoft.com/en-us/powerquery-m/date-isinnextnquarters