2022 Week 39 | Power BI: Use error bars to show statistical ranges

Introduction

We first looked at error bars in week 28. But error bars have several formatting features and can be used in several types of visuals. This week, we are going to use error bars to show a dynamically populated range around an average. 

Requirements

  • Calculate the average height and standard deviation for the heights.
  • Create a calculation for a confidence interval (assume normal distribution) that accepts input from a slicer on the page.
  • Allow user input to select to view either standard deviation or confidence interval. 
  • Allow user input to select a confidence interval as a number between 1 and 99.
  • Create a visual that shows the average height for boys, girls, and all students (boys and girls combined).
    • Use error bars to display the upper and lower values as a range around the average. The upper/lower values should be calculated based upon the user input of standard deviation or confidence interval.

Dataset

This week’s data is simulated data found on Github that has been made available in the public domain. 

Use Power BI to connect to the data at: https://raw.githubusercontent.com/ysk125103/datascience101/main/datasets/high_school_heights/hs_heights_flag.csv

It is a CSV file with 2 columns and 1000 rows.

Share

After you finish your workout, share on Twitter using the hashtags #WOW2022 and #PowerBI, and tag @JSBaucke@MMarie, @shan_gsd, @KerryKolosko, and @NerdyWithData. 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

Scroll to Top