Sneak Peak of a code inside a measure:

Wouldn’t it be awesome if we could sneak peak the code of a measure A when we are writing a different measure B and calling measure A inside B? going back and checking would mean exiting the current measure B then looking at the code of A and then you have to remember what the code is and also make a decision to call it or not basis the content? worry not Tabular Editor has something to offer:

Open your PBI file:

Click on external tools and open Tabular Editor:

Navigate to Advanced Scripting section and enter this code and click on run button:

=foreach (var Measure in Model.AllMeasures){ Measure.Description = Measure.Expression; }

it is a regular C# foreach loop that iterates over each measures in the AllMeasures collection(.net object/class) and then for each measure updates its description with its code.

And then in the diagram view you will be able to view the DAX code in the description.
image

That was just techy stuff, fun part starts now:

Let’s say you are really deep into the code and now you have to call a measure but you just don’t know how it will interact with the rest of the code, you can simply start writing and the description tooltip will pop up beside it


Now you can read its content without explicitly going to the measure and then checking the code and coming back

So cool!

5 Likes

Marking this thread as solved