Support SQL Window Functions.
So we can have row level "table calculations" that can be used as any other dimension or measure.
So we don't need to use custom SQL for this and experience its performance issues.
It could be done by special rawsql() functions or perhaps extended LoD functionality.
Several of the questions collected in Correlated Subquery could probably use a window function.
2018-03-12 ... devs ... are working on adding window function support ...