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.
- Obtain the Solution File from 2023 Week 35
- 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.
- 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.
- Calculate the Median of each Faceted group using the analysis grammar of your choice (DAX or Vega-lite for example)
- Layer a line with points depicting the medians across categories
There are two data sources for this week.
- Corruption Perceptions Index table from Wikipedia: https://en.wikipedia.org/wiki/Corruption_Perceptions_Index#2020%E2%80%932022
- 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.