Quick Tip: Building Measure Tests in Power BI

Quick Tip: Building Measure Tests in Power BI

Incorporate a unit testing framework into your Power BI reports with some simple measures combined with a matrix visualization.

Philip Trick

I've been diving pretty heavily into the Power BI world again recently. It's been over a year since I've done a Power BI blog post - not that there have been many blog posts at all!

In my forays into programming and - at Ahad's insistent urging - I have become a pretty fond user of unit testing to evaluate, confirm, and validate my code. As a user of Excel and Power BI, the toolsets available for creating frameworks for these checks is not nearly as robust as in the programming sphere; however, we make do.

In Power BI, after some Googling turned up this nifty way of writing some user tests in an addin, I wanted a way to build it within PBI as part of my report framework.. so I thought about it as a data problem.

What is a set of unit tests except for the matching of one set of data inputs against another? Create a pattern that brings them together relatively easily and begin writing your tests.

While these tests have a certain restriction to them that a true unit testing framework doesn't have, it's a nice and quick solution to help you build out your measures and data model.

As promised, you can click on this link to download most of the materials from this video.

Photo Credit:

Photo by National Cancer Institute on Unsplash
black and silver analog gauge