The AI-Enabled Power BI Tester
If you’ve followed my blog over the years, you’ll notice I emphasize the importance of testing your semantic models. DataOps stresses the principle of “Quality is Paramount” so that when we change our Power Query, DAX, or refresh our data, we can automatically check for issues whether we are developing the solution or publishing to production. Too many times have I seen the “Publish and Pray” method of Power BI development where we hope nothing goes wrong… hope is not a strategy. Furthermore, how do we expect our younger or newer team members to contribute positively and quickly if they have no safety checks? When they make a change, it should not negatively impact the model or its customers.
From the customer perspective, people will often forgive you when you make a mistake. But when they experience the same mistake again in production just days or weeks later, they lose trust.
Admittedly, Microsoft has made testing difficult in the past. But when the DAX Query View was released, this led me to identify a DAX Query View Testing Pattern. While this was a step forward, executing the tests still required consistent syntax and setup. What if we could standardize some of the common tests and, better yet, leverage AI to build and run these tests? Enter User Defined Functions (UDFs), and the nuget of UDFs… DAX Lib.
Over the past few months, my team and I have built a set of functions to aid in using the DAX Query View Testing Pattern while promoting reuse and allowing AI to assist. This library is called PQL.Assert. Assert is a common term used in testing where you assert a certain behavior, like “I assert this column in this table is distinct.” And if that assertion fails, then the test result indicates as such.
We’ve published the open-source library (yes, it’s free under MIT License) at this link.
You can also follow our video series demonstrating PQL.Assert to see it in action.