How to Create a Sparkline with Three Colors

Summary: set the sparkline "Max" to a larger number, then set the cell fill color to the desired third shade. Then boom, three-color sparkline. 

If you've never heard of or used Sparkline() before, Ben Collins has the best writeup on that right here - with many cool applications.

Goal: Create a horizontal sparkline that shows the coronavirus recovered, infected, and deaths all in one bar. I create one quickly below, then expand the sparkline by merging the cell horizontally. Not quite what I want yet. 

image-asset (5).gif

Problem: Sparklines are currently limited to two colors. Adding a third color returns an error, as see below.

image-asset (6).gif

Solution: set the sparkline Max to the sum of all three numbers - which will leave a blank space at the end exactly the size of the third, unused number. Then, you can just set the cell fill to the third color. Done!

image-asset (7).gif

A quick trick, but hope it helps someone out there.

Previous
Previous

Combine Rows in Power Query