2024 Week 5 | Power BI: Create a Strip Plot with Median Overlay

Introduction

Sometimes it can be useful to show all data points instead of aggregating them. That is where an instance chart, also called a strip plot or a barcode plot, can be useful. This week we are building on a faceted strip plot made in 2023 week 35, and adding a median overlay.

Inspired by a Makeover Monday entry from 2016, this plot uses updated Corruption Perceptions Index from Transparency International.

Requirements

  1. Obtain the Solution File from 2023 Week 35

OR

  1. Retrieve the data from Wikipedia and data.world.
    • Combine the data from the two sources in Power Query so that each country is associated with a continent.
    • Remove columns that don’t contain the country, rank, or CPI value from 2020 – 2022.
    • Unpivot the data so there is one column containing the year attribute and one column containing the CPI values from all years.
  2. Create a strip plot that contains one tick mark per row of data.
    • The continent should be shown on the y-axis.
    • The CPI value should be shown on the x-axis.
    • The visual should be faceted (turned into small multiples) by year.
    • A tooltip should show the country and the CPI value when you hover over a tick mark.
  3. Calculate the Median of each Faceted group using the analysis grammar of your choice (DAX or Vega-lite for example)
  4. Layer a line with points depicting the medians across categories

Dataset

There are two data sources for this week.

  1. Corruption Perceptions Index table from Wikipedia: https://en.wikipedia.org/wiki/Corruption_Perceptions_Index#2020%E2%80%932022
  2. The Countries and Continents file on data.world: https://data.world/mlongoria/countriescontinents

You can use the data.world connector in Power BI (recommended) or download the Excel file to your local machine. You will need to log in to data.world to retrieve the data, but accounts are free.

Share

After you finish your workout, share on Twitter using the hashtags #WOW2023 and #PowerBI, and tag @MMarie, @shan_gsd, @KerryKolosko. 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 via Data Stories Gallery

Coming soon.

Scroll to Top