Debugging DAX is not nearly as advanced or user-friendly in Power BI, Excel, and SQL as debugging in the IDEs for many other programming languages. While IDEs for other languages include the ability to set code execution breakpoints, step through code, and watch variable values change during code execution, the environments in which DAX is written do not provide similar capabilities. Hence, debugging DAX is unquestionably more old school when it comes to trying to figure out what is wrong with a particular calculation. This recipe provides a technique to assist in troubleshooting efforts that leverages DAX's COUNTROWS function.
Debugging with COUNTROWS
Getting ready
To prepare for this recipe, perform the following steps...