-
Book Overview & Buying
-
Table Of Contents
DAX for Humans
By :
When writing any kind of code, one will inevitably need to fix problems (debug) and DAX is no exception. Luckily, if you are following the No CALCULATE approach to DAX, you are already ahead of the curve when it comes to debugging your DAX code. The reason is that the No CALCLULATE approach breaks problems down into steps, using a variable (VAR) for each step. Thus, you can easily modify the RETURN statement to return any of the intermediate steps in your DAX calculation. This is invaluable because the results of DAX calculations are dependent upon context and thus being able to see intermediate steps in context is critical to debugging efforts.
As covered in Chapter 2, More Core Concepts in the section Visualizing Your DAX, you can use TOCSV to return variables that contain tables. Prior to the existence of the TOCSV function, we used to use the CONCATENATEX function to achieve similar results. While the combination of variables and the TOCSV function will likely solve...