Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started
Let's start with a little riddle.
Let's see how much the Brits love their tea 🙃
What do you think is the percentage of Brits who drink tea regularly?
And now, have you gotten the same answer with the same accuracy, speed, and confidence level?
Why is it more challenging to get an accurate answer from pie/donut charts and why do we feel less confident trying to read them?
The main reason is the difficulty in calculating the areas of the pie slices/lengths of the donut arcs.
This is much more challenging and less confident than comparing the areas of rectangular shapes.
For those who want to delve deeper, I've also included a link to a very interesting study on the subject.
A well-designed waffle chart with the necessary supporting elements allows for quick and accurate estimation, eliminating the need to calculate areas.
Unfortunately, the waffle charts in our arsenal do not achieve the same results as the one shown in the image above.
So, what can we do?
We'll use the magic of the matrix in combination with some DAX and conditional formatting 😉
How will it work?
1. We'll create a 10 x 10 table using DAX.
2. In this step, we create a measure that divides our percentage measure (percent_tea, in my case) into tens and units in the first stage.
In the second stage, it scans the matrix we created earlier and fills each selected cell with 1 if the value is greater than 0, and with 0 if there is no value.
3. Now we have come to the point where we only have design work left:
a. We will create a matrix, and choose the design type: None + switch off the totals
b. We will define conditional formatting for the background of the cells:
To Hide the numbers we'll apply the same steps for the fonts :
To help users read the chart without counting the squares, we will add labels using text boxes.
I have added labels for the beginning, middle, and end. It is possible to add more labels, for example, every 10%
And finally 🙂 All that's left is to group the entire construction so it stays in place
The pbix with the example is attached
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.