DAX evaluation context indicator with syntax highlighting

This is a post about a feature request, that definitely would make my life easier (and I guess others’ too):

Evaluation context and its transition is one of the hardest concepts in DAX and I would find it extremely helpful, if syntax highlighting would assist us here. Let the colour of the table name show whether the expression will be evaluated:

        • in a row context (so the table name represents the record/current row and a scalar value will be returned, Color: purple):

          SumOfSales = Sales[SalesAmount]

        • in a filter context (so the table name represents the (eventually filtered) table and a list of its column values is returned instead, Color: gold):

          SumOfSales = CALCULATE(SUM(Sales[SalesAmount]))

        • Ideally, it would also indicate if a filter is active or not (or can become active once the measure is used in a pivot table). So with an empty filter, there would be no syntax highlighting:

          SumOfSales = SUM(Sales[SalesAmount])

        • In an iterator, where both contexts are active, the highlighting would look like this:

          SumOfSales = SUMX(Sales, Sales[SalesAmount] + 1.1)

        • Not sure what to suggest for syntax sugar like boolean expressions in the CALCULATE-statements, maybe they should get an overall Color like this?:

          SaleOfRedProducts = CALCULATE (

          SUM ( Sales[SalesAmount] ),

          Product[Color] = “Red” )

      So while we cannot visualize all existing contexts here, the aim of the colours is to show what kind of value the table name represents: A record, a table or if it is part of syntax sugar for a boolean expression. Thereby helping the users to read and interpret the formulas and to identify all relevant evaluation contexts.

    •  

      Please have a look at the screencast:

    • If you would like to see this implemented, please vote for the feature here: Vote for context highlighting

A lightweight-version would be just to highlight the row-context. (And maybe the boolean expressions )

Please let me know what you think of it. Especially what you don’t like and the challenges you see with it or why you think that this is a bad idea.

Thanks a lot and stay queryious 😉

Leave a Reply

Die Datenschutzbestimmungen finden Sie hier: / Please find the privacy policy here: https://wp.me/P6lgsG-Rz