ISONORAFTER
Whether a list of values is the same as another or comes after it, pair by pair, in the order given.
Group: Information. Compatible with DAX.
Syntax
ISONORAFTER ( <value1>, <value2> [, <order>] [, <value1>, <value2> [, <order>] ] … )
| Parameter | Type | Description |
|---|---|---|
value1 | Value repeatable | A value of the row being tested, usually a column in a row context. |
value2 | Value repeatable | The value it is compared with, such as a constant. |
order | Keyword 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 are the same as the second ones or come after them, in the order given.
Remarks
- The pairs are compared one after another: the first pair decides unless its values are equal, then the next one. When every pair is equal, the result is TRUE;
ISAFTERgives FALSE then. - It is the test behind a query's
START AT: inFILTER, it keeps a row and everything sorted after it. - Text is compared without regard to case. A blank sorts just before zero (so after −1), 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
December 2025 and the months after it
The order between the two pairs is left empty, so it is ASC.
EVALUATE
VAR Months =
DATATABLE (
"Year", INTEGER, "Month", INTEGER,
{ { 2025, 11 }, { 2025, 12 }, { 2026, 1 }, { 2026, 2 } }
)
RETURN
FILTER ( Months, ISONORAFTER ( [Year], 2025, , [Month], 12 ) )
ORDER BY [Year], [Month]
| Year | Month |
|---|---|
| 2025 | 12 |
| 2026 | 1 |
| 2026 | 2 |
Equal, before and after
EVALUATE
ROW (
"5 and 5", ISONORAFTER ( 5, 5 ),
"4 and 5", ISONORAFTER ( 4, 5 ),
"6 and 5", ISONORAFTER ( 6, 5 ),
"IPA and Pils, DESC", ISONORAFTER ( "IPA", "Pils", DESC )
)
| 5 and 5 | 4 and 5 | 6 and 5 | IPA and Pils, DESC |
|---|---|---|---|
| TRUE | FALSE | TRUE | TRUE |
Where a blank sorts
A blank comes after −1 and just before 0.
EVALUATE
ROW (
"Blank and 0", ISONORAFTER ( BLANK (), 0 ),
"0 and blank", ISONORAFTER ( 0, BLANK () ),
"Blank and -1", ISONORAFTER ( BLANK (), -1 ),
"Empty text and blank", ISONORAFTER ( "", BLANK () )
)
| Blank and 0 | 0 and blank | Blank and -1 | Empty text and blank |
|---|---|---|---|
| FALSE | TRUE | TRUE | TRUE |