Date.IsInNextQuarter is a Power Query M function that indicates whether the given date(time) value occurs during the next quarter, 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.IsInNextQuarter( dateTime as any ) as nullable logical
Description
Date.IsInNextQuarter test if a given value (of type date, datetime, or datetimezone) falls in the next quarter relative to the current system date and time, excluding the current quarter.
Examples
Let’s explore two straightforward examples to understand how the Date.IsInNextQuarter function works.
Checking for Dates within the Next Quarter
Let’s say you have a calendar table and you want to add a column that shows true
for dates that are in the next quarter. You can do this by using the Date.IsInNextQuarter
function on your [Date]
column.
Date.IsInNextQuarter( [Date] ) // Output depends on [Date] column
This expression returns true
for any date in the [Date]
column that falls within the next quarter.
For example, if today is July 6, 2024, this function will return true
for all rows with dates between October 1, 2024, and December 31, 2024. Here’s a screenshot showing this:
You can see that dates within the next quarter are marked with true
.
Using the Current Date and Time
To test if the quarter following the current system time falls within the next quarter, you can use the following expression:
// Output: true
Date.IsInNextQuarter( Date.AddQuarters( DateTime.FixedLocalNow(), 1 ) )
Related functions
Other functions related to Date.IsInNextQuarter are:
2023-2024 © BI Gorilla. All rights are reserved. Information from Microsoft docs is property of Microsoft Corp. | Privacy Policy