How to Visualize Your Music Data

Step by step instructions to see and understand your music listening data using Tableau.

Music is a daily part of many of our lives and the year is coming to an end. Wouldn’t it be cool if you could see what your music said about you this year? You don’t have to wait for your music streaming service to provide that for you anymore—you can see and learn from your listening data at any point in the year using Tableau. Whether this is your first Tableau visualization or your 100th, let this be a chance to practice and grow your viz-building skills using your own personal data! It doesn’t have to end with this year either—you can even look at your lifetime streaming patterns and see how your music taste has evolved.

If you’re hooked and ready to see how many times you’ve streamed Taylor Swift’s Anti-Hero or Rihanna’s first release in 6 years, keep reading. We’ll teach you how to make a viz with Tableau that provides uniquely personal insights with an easy to understand interface, step-by-step.

Navigating the Tableau Workspace

Before learning any new vocabulary, we should make sure we know what Tableau is first. Tableau is a visual analytics platform that empowers all people and organizations to make the most of their data with an easy-to-navigate interface, no coding skills necessary. We’ve created a glossary of Tableau vocabulary you may encounter that you can reference as you go throughout this project.

Term Definition
dashboard

A collection of views shown in a single location where you can compare and monitor a variety of data simultaneously.

dimension

Qualitative values, such as names, dates, or geographical data. Colored blue.

filter

A control on a view that limits the data shown in a view. For example, a filter on Region that only includes the West.

mark

A visual representation of one or more rows in a data source. Mark types can be bar, line, square, and so on.

measure

Numeric, quantitative values that you can measure. Measures can be aggregated. Colored green.

pill

Piece of data.

tooltip

Details that appear when you rest the pointer over one or more marks in the view.

union

A method for combining data by appending rows of one table onto another table.

worksheet

A single view of data. Each worksheet can be connected to a single data source.

Start Page for Tableau Desktop version 2022.2.1. Image sourced from Tableau Student Ambassador Jason Khu’s The Tableau Desktop Workspace Interface Guide.

Start Page for Tableau Desktop version 2022.2.1. Image sourced from Tableau Student Ambassador Jason Khu’s The Tableau Desktop Workspace Interface Guide.

 

Data Source page for Tableau Desktop version 2022.2.1. Image sourced from Tableau Student Ambassador Jason Khu’s The Tableau Desktop Workspace Interface Guide.

Data Source page for Tableau Desktop version 2022.2.1. Image sourced from Tableau Student Ambassador Jason Khu’s The Tableau Desktop Workspace Interface Guide.

 

Sheet view from Tableau Desktop 2022.2.3.

Sheet view from Tableau Desktop 2022.2.3.

Access Tableau

Don’t already have Tableau on your machine? Here are a few ways to get access and start creating.

Option 1: Access a Tableau for Students License

If you are a current student at an accredited institution, head on over to the Tableau for Students webpage and click on “Get Tableau for Free.” You can fill out your information and, once you’re verified, you’ll get a product key to activate your Tableau software.

Option 2: Use Tableau Public

If you aren’t a current student, you can either use the online version or download Tableau Public onto your machine for free. Tableau Public is a free platform to explore, create, and publicly share data visualizations online. Head to this blog post to learn how to access either Tableau Desktop Public Edition or Web Authoring.

Depending on where you listen to your music and podcasts, how you get your data may differ. Instructions for getting Spotify and Apple Music data are below. If you use neither music application or are having trouble accessing your data, feel free to follow along with this sample data.

For Spotify

1) Acquire Your Streaming Data

  1. Open up open.spotify.com in your web browser. 
  2. Click on your name in the top right corner and then click on “Account.” 
  3. Navigate to the left side of the page and click on “Privacy Settings.” 
  4. Scroll down to the section labeled “Download Your Data” and look toward “Account Data.” Make sure to check the box next to “Select Account data.” 
  5. (Optional) If you would like to look at your streaming data to date, you can also request your “Extended Streaming Data” by additionally checking the box next to “Select Extended streaming data.” 
  6. After checking the applicable boxes, scroll down to the bottom of the page and click “Request Data.” 

You might be asked to verify your data request via your email inbox. After confirming, you should receive your account data from the previous year within the next 7 days. Your Extended Streaming Data may take up to 30 days to get compiled and sent to your inbox.

1.5) (Optional) Convert Milliseconds to Hours

When you download your Spotify data, the time measure they use is milliseconds, written as ms. While converting milliseconds to hours is an optional step, it makes your final viz easier to understand and digest. Feel free to skip down to the next section if you don’t want to translate the time. If you would like to change the units to hours, read below to learn how.

  1. The first step will be to combine your streaming history files if you received more than one. You may have more than one depending on how much music you listened to. You will find these files after opening the .zip file that Spotify sent you. 
  2. Next, merge however many streaming history files you have into one. I use this site to combine my JSON-type files. 
  3. After combining them, you should have one JSON-type file that contains all of your streaming history.
  4. Now, you’ll want to convert that combined streaming history file into an Excel or CSV file. Head to this website and scroll down until you see “Step 1,” upload your file, then convert it to an Excel file. 
  5. We need to add the “Hours played” column to this new file. Open up the file in whatever spreadsheet editor you use. 
  6. Create a new column in your data and label it “Hours played.” 
  7. Underneath the title in the next row, input a formula that converts milliseconds (taken from the “msPlayed” column) to hours. This will be the quantity under “msPlayed” multiplied by 0.000000277778. My formula looked like “=E2*0.000000277778,” where E2 is the first value in the “msPlayed” column. 
  8. Select the first box with the formula in it and press command+D if you have a Mac or Ctrl+D if you have a Windows computer. This will apply the formula to the entire column. If using sheets, drag the yellow circle all the way down the entire column to apply the formula.
  9. Finally, we’ll convert our file with the “Hours played” column back into a JSON file to make it compatible with the rest of the original files. You can do so by uploading your new file to this website and converting it to a JSON file. 

This new JSON file will replace the “Streaming History File” referred to in the instructions below. The “Hours played” column and measure will replace any measures related to milliseconds or “msPlayed” in the instructions.

2) Load Your Data into Tableau

  1. Open up the .zip file that Spotify sent you. Your data should open in a folder titled “My Data.” Depending on how long your streaming history is, there might be multiple Streaming History files which will need to be put in a union later on. 
  2. For now, open up Tableau and, in the Connect Pane, click “JSON file.” Open up your streaming history file (if you have more than one, click on the first). 
  3. Ensure all of the schema levels are selected and click OK. You should see the file in the canvas. You should see on the left side of the program, under “Files,” other JSON files within the MyData folder. If you have additional streaming history files, we will need to make a union with the additional streaming history files. 
  4. Drag and drop the second streaming history file underneath the primary file on the canvas so that it highlights and shows “union.” A union has now been created between the two streaming history files. 
  5. Ensure that the schema is entirely selected by clicking the arrow next to the file name and selecting “Select schema level.” Make sure everything is checked.
  6. Repeat step 4 until all of your streaming history files are incorporated.
  7. Now, we’ll incorporate a different file titled “Playlist1.” Hover over “data” in the menu and click “New Data Source.” Alternatively, click on the Tableau logo in the top left. 
  8. In the Connect pane, click “JSON file” to then open the “Playlist1” file. 
  9. Ensure all of the schema levels are selected and click OK. 

At this point in time, both data files have been successfully uploaded and we can start exploring our data!

 Creating a union in Tableau 2022.2.2

Creating a union in Tableau 2022.2.2

3) Explore Your Data in Tableau

Switch over to Sheet 1 in the sheets tab on the bottom and start making different visuals! We’ll walk through some useful features in Tableau and how to make a sheet for your most played artists, then hand over the reins for you to draw your own insights.

Making Groups

To highlight specific metrics on our charts and graphs, we’ll need to learn how to make groups. Just select all of the values you want to be included in a group then right-click on the metric and select “Group.” It should have a paperclip icon. You can rename the group by right clicking on its name in the legend on the right and select “Edit Alias…” Now that the group is created, you can go to the Color mark and select your color preference.

 Select points to make a group and rename them to make your worksheet easier to understand in the legend.

Select points to make a group and rename them to make your worksheet easier to understand in the legend.

Using Tooltips

Tooltips are created automatically in Tableau but you can also edit them to say exactly what you want it to say! You can change labels or wording to make it easier to understand by clicking on the Tooltip square in the Marks pane. This will open up a text editor where you can add and edit text describing points on your worksheet. Texts in a gray box are drawing statistics directly from the sheet mentioned.

Tableau visualization

Make changes to tooltips by selecting the tooltip card and editing within the text box.

Making Worksheets

  1. Rename the worksheet by right-clicking the tab on the bottom and click rename.
  2. Drag the “Artist Name” dimension to the Rows shelf.
  3. Drag the “Ms Played per Document” (or “Hours Played”) measure to the Columns shelf. Confirm that this appears as the Sum of Ms played by looking at the green pill. It should read SUM(Ms Played per Document).
  4. Reorganize the graph to sort descending in the toolbar.
  5. Apply any filters you would like by going to the Analysis menu, hovering over filters, and then filtering either axis (Ms preferred).
  6. Follow the same process as above to make the following suggested charts or make your own to explore any questions you might have of your own data! Feel free to rename any labels or values on the charts to make the data easier to understand.

Follow the same process as above to make the following suggested charts or make your own to explore any questions you might have of your own data! Feel free to rename any labels or values on the charts to make the data easier to understand.

Recommended Charts

chart title rows shelf columns shelf filters Marks

Most Played Artists (Bar chart)

Artist Name

SUM(Ms Played per Document)

SUM(Ms Played per Document)  

Most Played Tracks (Bar chart)

Track Name

SUM(Ms Played per Document)

SUM(Ms Played per Document))

Artist Name on Tooltip

Playlists with the Most Tracks (Bar chart)

Playlist Name

SUM(Number of Records per Playlist1)

SUM(Number of Records per Playlist)

SUM(Number of Records per Playlist) on Label - Min/Max only

Tracks w/ Most Listening Sessions (Bar chart)

Track Name

CNT(End Time)

CNT(End Time)

Artist Name on Tooltip

Listening Session End Times (Line Graph)

CNT(End Time)

HOUR(End Time)

 

CNT(End Time) on Tooltip and Label - Min/Max only

Hours Played by Month (Line Graph)

SUM(MS Played per Document)

MONTH(End Time)

  Show Mark Labels - Min/Max only
Most followed playlists (stacked Bar)

SUM(Number of Followers per Playlist)

Playlist Name (Groups)

CNT(Number of Followers per Playlist) SUM(Number of Tracks per Playlist) on Tooltip

For Apple Music

1) Acquire Your Streaming Data

  1. Head on over to privacy.apple.com in your web browser and sign in with the Apple ID you use for Apple Music. 
  2. Complete any authentication required to sign in and then click “Request a copy of your data.” 
  3. Check the box to the right of “Apple Media Services Information.” This will give you access to a few different types of data, including your music data. 
  4. Scroll down to the “Continue” button and you’ll be directed to a page where you can pick the maximum file size you’d like a single file to be. The larger the maximum file size, the less divided your data will be. 
  5. Click “Complete Request” and you will receive a confirmation email saying that you will receive your listening data within 7 days.

2) Load Your Data into Tableau

Open up the .zip file that Apple sent you. Your data should open in a folder titled “Apple Media Services Information.” You’ll need to open this file and then open a .zip file titled “Apple_Media_Services.” Once you open the zip and the corresponding file, you should see a folder titled “Apple Music Activity.” Our desired file is “Apple Music - Play History Daily Tracks.”

Now, open up Tableau and, in the Connect Pane, click “More…” and open to the play history file from above. You should see on the left side of the program, under “Files,” other csv files within the same folder.

3) Explore Your Data in Tableau

Switch over to Sheet 1 in the sheets tab on the bottom and start making different visuals. We’ll walk through some useful features in Tableau and how to make a sheet for your most played tracks, then hand over the reins for you to draw your own insights.

Making Groups

To highlight specific metrics on our charts and graphs, we’ll need to learn how to make groups. Just select all of the values you want to be included in a group then right-click on the metric and select “Group.” It should have a paperclip icon. You can rename the group by right clicking on its name in the legend on the right and select “Edit Alias…” Now that the group is created, you can go to the Color mark and select your color preference. 

 Select points to make a group and rename them to make your worksheet easier to understand in the legend.

Select points to make a group and rename them to make your worksheet easier to understand in the legend.

Using Tooltips

Tooltips are created automatically in Tableau but you can also edit them to say exactly what you want it to say! You can change labels or wording to make it easier to understand by clicking on the Tooltip square in the Marks pane. This will open up a text editor where you can add and edit text describing points on your worksheet. Texts in a gray box are drawing statistics directly from the sheet mentioned.

Editing Tooltips

Make changes to tooltips by selecting the tooltip card and editing within the text box.

Making Worksheets

  1. Rename the worksheet by right-clicking the tab on the bottom and click rename.
  2. Drag the “Track Description” dimension to the Rows shelf.
  3. Drag the “Hours” measure to the Columns shelf. Confirm that this appears as the Count of Hours by looking at the green pill. It should say CNT(Hours).
  4. Reorganize the graph to sort descending in the toolbar.
  5. Apply any filters you would like by going to the Analysis menu, hovering over filters, and then filtering either axis (Hours preferred).

Follow the same process as above to make the following suggested charts or make your own to explore any questions you might have of your own data! Feel free to rename any labels or values on the charts to make the data easier to understand.

Recommended Charts

Date Name Announcements Prizes Marks

Tracks w/ Most Unique Listens

Track Description

SUM(Play Count)

SUM(Play Count)

 

Most Skipped Tracks

Track Description

SUM(Skip Count)

SUM(Skip Count)

 

Hours per Streaming Device

Source Type

CNTD(Hours)

   

Hours Played by Month

CNTD(Hours)

Month(Date Played)

 

Show Mark Labels - Min/Max only

How Tracks Ended

End Reason Type

CNT(Track Description)

   

 

Plug Your Worksheets into a Dashboard and Decorate

Now that we’ve created all of the different worksheets we want in our final dashboard, we can bring everything together! To create a new dashboard, hover over the “Dashboard” setting and click “New Dashboard.” You can also click on the button in the sheets tab next to “New Worksheet.” Here, you can drag and drop any worksheets you’ve made from the Dashboard Pane on the left of the program. You can even import images, add text, and reformat through horizontal or vertical sections in your dashboard. 

Feel free to add context to your dashboard by right clicking a specific worksheet, hovering over “annotate,” and clicking on “point” or “area”. This allows you to add text onto your worksheets that explain points or your chart. Make filters visible and interactive by clicking on a worksheet, and heading to the “More Options” arrow and hovering over “Filter.”

Decorating a dashboard can be intimidating, so we’ve also created a template that you can feel free to plug your own worksheets into! Just download this Tableau Public dashboard as a workbook template and plug in your data to the included dashboard. You’ll want to make sure to update the data that’s being accessed.

Decorating a dashboard can be intimidating, so we’ve also created a template that you can feel free to plug your own worksheets into! Just download this Tableau Public dashboard as a workbook template and plug in your data to the included dashboard. You’ll want to make sure to update the data that’s being accessed.

Build a dashboard by simply dragging and dropping worksheets, spaces, and customizing titles.” 

Upload Your Wrap-Up to Tableau Public with #MyYearThroughMusic

The final step is to share your amazing insights and Tableau dashboard with the world! You can upload your viz to your Tableau Public account and tag it with #MyYearThroughMusic to show off what your year through music looked like. Depending on what version of Tableau you used, how you upload your viz may vary. By tagging your viz, you’re making your viz searchable by others who are making their own music visualizations. You can also take a look at theirs by searching for the tag directly in Tableau Public or clicking on the tag from your own viz.

Exporting from Tableau Desktop

  1. In the menu, select “Server,” then “Tableau Public,” then click “Save to Tableau Public.”
  2. Sign in using your Tableau Public account or create one if you don’t have one.
  3. Type a title for your workbook and click “save.” You should be redirected to the Tableau Public website.
  4. Hover over your viz and click “view,” then select edit details and make sure to include #MyYearThroughMusic in your viz’s description. Your viz is now published and ready to show the world!

publishing on tableau public

Exporting a dashboard to Tableau Public from within Tableau Desktop.

Exporting from Tableau Desktop Public Edition

  1. Go to the “File” menu and click “Save to Tableau Public As…”
  2. Sign in using your Tableau Public account or create one if you don’t have one.
  3. Type a title for your workbook and click “save.” You should be redirected to the Tableau Public website.
  4. Hover over your viz and click “view,” then select edit details and make sure to include #MyYearThroughMusic in your viz’s description. Your viz is now published.

Exporting from Tableau Public Web Authoring

  1. Click “Publish As…” in the top right of the screen, name your workbook, then click “Publish.”  You should be redirected to the Tableau Public website.
  2. Hover over your viz and click “view,” then select edit details and make sure to include #MyYearThroughMusic in your viz’s description. Your viz is now published.

Congratulations, now you know how to visualize your music data

You did it! You’ve made an amazing viz that tells the story of your year and found insights that matter to you. It doesn’t have to end with this viz—your music wrap-up can be something that you return to every year, season, or month. You can continue to work those creative juices with your Tableau for Student license or over on Tableau Public. Take a minute to look over some other ways that our DataFam has looked at music data in the past through our Data + Music stories. If you’re looking to work more with music data, you can get involved in the monthly #DataPlusMusic Tableau Community project founded by Tableau Visionary Sean Miller. We’ve included some resources below too that could be helpful along your Tableau journey. Who knows? Maybe your next challenge could be Iron Viz: Student Edition which will be opening for submissions soon.

Resources