OpenBI Docs Buy

ISAFTER

Whether a list of values comes after another, pair by pair, in the order given (as START AT does).

Group: Information. Compatible with DAX.

Syntax

ISAFTER ( <value1>, <value2> [, <order>] [, <value1>, <value2> [, <order>] ] … )
ParameterTypeDescription
value1Value
repeatable
A value of the row being tested, usually a column in a row context.
value2Value
repeatable
The value it is compared with, such as a constant.
orderKeyword
optional, repeatable
ASC (ascending, when left out) or DESC (descending): the order of this pair; 1 or TRUE, 0 or FALSE say the same, and any other value is an error. Between two pairs it may be left empty, with nothing between the commas: ASC.

Returns

Boolean. TRUE when the first values come strictly after the second ones, in the order given.

Remarks

  • The pairs are compared one after another, as a sort on several columns does: the first pair decides, unless its two values are equal; then the next pair decides, and so on. When every pair is equal, the result is FALSE; ISONORAFTER gives TRUE then.
  • It is the strict form of the test behind a query's START AT: inside FILTER it keeps the rows that come after a given row of a sorted list, such as the months after December 2025.
  • Text is compared without regard to case. A blank sorts just before zero, and before any text, empty text included.
  • Two values of types that cannot be compared, such as a number and a text, are an error.

Examples

The months after December 2025

The year decides first; the month only when the year is 2025.

EVALUATE
VAR Months =
    DATATABLE (
        "Year", INTEGER, "Month", INTEGER,
        { { 2025, 11 }, { 2025, 12 }, { 2026, 1 }, { 2026, 2 } }
    )
RETURN
    FILTER ( Months, ISAFTER ( [Year], 2025, ASC, [Month], 12, ASC ) )
ORDER BY [Year], [Month]
YearMonth
20261
20262

After, or on or after

December 2025 itself is not after December 2025, but it is on or after it.

EVALUATE
VAR Months =
    DATATABLE (
        "Year", INTEGER, "Month", INTEGER,
        { { 2025, 11 }, { 2025, 12 }, { 2026, 1 }, { 2026, 2 } }
    )
RETURN
    ADDCOLUMNS (
        Months,
        "ISAFTER", ISAFTER ( [Year], 2025, ASC, [Month], 12, ASC ),
        "ISONORAFTER", ISONORAFTER ( [Year], 2025, ASC, [Month], 12, ASC )
    )
ORDER BY [Year], [Month]
YearMonthISAFTERISONORAFTER
202511FALSEFALSE
202512FALSETRUE
20261TRUETRUE
20262TRUETRUE

Descending order

From the largest down, 40 comes after 100. 0 and FALSE are other ways to write DESC.

EVALUATE
ROW (
    "DESC", ISAFTER ( 40, 100, DESC ),
    "0", ISAFTER ( 40, 100, 0 ),
    "FALSE", ISAFTER ( 40, 100, FALSE ),
    "ASC", ISAFTER ( 40, 100, ASC )
)
DESC0FALSEASC
TRUETRUETRUEFALSE

ISONORAFTER, FILTER, TOPN, WINDOW, OFFSET.

Last updated · OpenBI Studio 0.3.74