Forum Discussion
finding the lowest three values in a column
- 4 years ago
The curly brackets are an expression to create a table. So {1, 2, 3} creates virtual table (since it´s in a measure) which looks like
The IN operator returns TRUE if a row value exists within a table.
So in the measure you posted, RANKX calculates the rank of the value in ascending order (so the lowest's rank will be 1, the second lowest 2 etc...)
So basically the [Lowest values] measure is calculating the values where the [RANKX] measure returns a value of 1, 2 or 3. (So the three lowest values)
Make sense?
The curly brackets are an expression to create a table. So {1, 2, 3} creates virtual table (since it´s in a measure) which looks like
The IN operator returns TRUE if a row value exists within a table.
So in the measure you posted, RANKX calculates the rank of the value in ascending order (so the lowest's rank will be 1, the second lowest 2 etc...)
So basically the [Lowest values] measure is calculating the values where the [RANKX] measure returns a value of 1, 2 or 3. (So the three lowest values)
Make sense?
Excellent PaulDBrown - crystal clear