Forum Discussion
Return a value when lookup between 2 columns
- 6 years ago
OK think I have it - only the Max before the filter is required
Sort Order = CALCULATE( MAX('Data Range'[SORT_ORDER]), FILTER( 'Data Range', 'Table'[ACC_REF] >= 'Data Range'[Low] && 'Table'[ACC_REF] <= 'Data Range'[HIGH] ) )Thanks for getting me on the right track
Thanks edhans
Just getting a single value returned. It is the corresponding value of [SORT ORDER] for the MAX value of [LOW] [HIGH]. Not sure if important but [LOW] [HIGH] not sorted in 'Data Range'
So it is or is not working? The sort order is 100% irrelevant for DAX. It doesn't care. It will sort for you and report if you want in the visuals, but nothing in DAX cares about the sort order. It is just records to filter and calculate on.
- cjulianm6 years ago
Advocate I
No not working
- cjulianm6 years ago
Advocate I
It just returns the SORT_ORDER value corresponding to the maximum vale of [LOW] & [HIGH] for all values
- cjulianm6 years ago
Advocate I
OK think I have it - only the Max before the filter is required
Sort Order = CALCULATE( MAX('Data Range'[SORT_ORDER]), FILTER( 'Data Range', 'Table'[ACC_REF] >= 'Data Range'[Low] && 'Table'[ACC_REF] <= 'Data Range'[HIGH] ) )Thanks for getting me on the right track