2024 Week 49 | Power BI: Visualize Ranges with Percentiles

Introduction

A percentile is a number denoting the position of a data point within a numeric dataset by indicating the percentage of the data points with an equal or lesser (assuming it’s inclusive) value. Percentiles can be used to understand test scores, stock values, health indicators, and other values. This week, we will use them to look at blood glucose measurements. 

In the United States, 11.6% of the population has diabetes. For those with diabetes, it’s important to manage their blood glucose (or blood sugar) levels. In the United States, blood glucose levels are measured in mg/dL (milligrams per deciliter). The US Centers for Disease Control and Prevention recommends a target range of 80 to 180 mg/dL. Today, many people (diabetic or otherwise) wear a CGM (continuous glucose monitor) to get blood sugar readings every few minutes. Since blood sugar changes as we eat, it’s helpful to look at data based upon the time of day or in relation to meal time. That is what we are visualizing this week. We are looking at measurements for multiple days and visualizing percentiles for each time of day with reference lines overlaid to show where values are in or out of range. The visual below is created from the line chart core visual – no custom visuals needed. 

Requirements

  1. Get the data.
  2. Split the date and time into separate columns. 
  3. Create measures for the 5th, 25th, 50th, 75th, and 95th inclusive percentiles. 
  4. Create a chart with time of day on the x-axis and blood glucose percentiles on the y-axis. Each percentile should be represented by a line. The 95th and 5th percentile lines should be dashed. The 25th, 50th, and 75th percentile lines should be solid. There should be light shading in between the 75th and 95th percentile lines and between the 5th and 25th percentile lines. There should be medium shading between the 25th and 75th percentile lines.
  5. Label the percentile lines directly in the chart next to the lines and hide the legend. 
  6. Add reference lines for the values 80 and 180.  

Dataset

Data for this challenge can be found on Data.World at https://data.world/mlongoria/wow2024wk49

 The data has been created for this challenge. There is a single table in the dataset.

Note: Data.World requires you to create a free account to access the data. You may use the Data.World connector in Power BI or download the file to your local machine and connect to it there.

Share

After you finish your workout, share on social media using the hashtags #WOW2024 and #PowerBI. On Bluesky, tag mmarie.bsky.social, shan-gsd.bsky.social, and merrykerry.bsky.social.

Also make sure to fill out the Submission Tracker so that we can count you as a participant this week in order to track our participation throughout the year.

Solution

Solution File available for download from the data stories gallery.

Coming soon!

Scroll to Top