Skip to main content

Power BI

New

DAX Pipe Operator

Vote (2) Share
Luke Walker's profile image

Luke Walker on 07 Jun 2019 21:55:17

A DAX pipe operator would allow function outputs to be piped to another function rather than nesting or written to a variable. This would streamline code writing.
E.g.:
SUMMARIZECOLUMNS () %>% ADDCOLUMNS () %>% FILTER ()
rather than:
FILTER(ADDCOLUMNS(SUMMARIZECOLUMNS () ))

Comments (1)
Luke Walker's profile image Profile Picture

5a09c956 9d3e-4112-9039-492d22b24fa0 on 06 Jul 2020 00:00:47

RE: DAX Pipe Operator

The pipe syntax is best for short code. DAX code tends to be a bit too long for piping to increase readability.

If you won't like nesting functions within functions, you can use variables to store the result of each function and use the result of one variable in the calculation of the next variable.
VAR SummarizeCol = SUMMARIZECOLUMNS ()
VAR AddCol = ADDCOLUMNS(SummarizeCol,)
VAR FilterTable = FILTER(AddCol,)
RETURN FilterTable