Dear Analyst #103: How to use one of the best features in PivotTables to filter your data (Slicers)
Listen now
Description
I used to create a monthly 30-slide report and each slide had a different table or chart that I copied and pasted from Excel. As a naive analyst, I literally filtered my list of data using regular dropdown filters on each column to get the numbers I needed. I would filter, sum or average the data, and then enter the data onto the slide. It was super manual work. One benefit was I got really good at using keyboard shortcuts to filter a list of data. I didn't realize that a PivotTable could easily automate my report. I could've built several PivotTables off of my raw data, stuck each PivotTable on an individual worksheet, filter each PivotTable to the data I need, and I'm done. PivotTables continue to be one of the most important features in Excel, and in this episode I walk through how to use Slicers, one of the best features for filtering your data in PivotTables. You can download the Excel workbook used in this episode here. I also just launched a new Advanced PivotTable Dashboard class on Skillshare which I'll talk about at the end. Watch this episode to see a video tutorial on how to use Slicers in PivotTables https://www.youtube.com/watch?v=HiyDGYs5EOM How to create a PivotTable using YouTuber data The raw data (download file for this episode) we we are using for this episode is a list of the top 200 YouTubers and data associated with their channels. Interestingly, I don't recognize many of the channels on this list (or I just don't watch enough YouTube): Let's create a PivotTable to better filter through this list of 200 YouTubers. It's not a huge list but maybe we'd like a quick way to see the top channels in a certain country, category, etc. On a Mac Excel, the easiest way is to go to the Insert menu, click on PivotTable, and then hit OK. You can keep all the settings in the menu as is since we want to create a PivotTable on a new worksheet: If you don't want to start from scratch with building a PivotTable, you can have Excel suggest a PivotTable for you. Instead of clicking on the PivotTable button, click on "Recommended PivotTables" and you'll see a worksheet get created with the PivotTable fields filled out: Building out PivotTable with filters, rows, and columns Let's summarize our data in this PivotTable by finding the average number of Likes and Followers by Main Video Category and then Category. To set this up, your PivotTable fields should look like this: The resulting PivotTable isn't well formatted as you can see below: A few things we can do to fix the formatting so this PivotTable is a bit more clear: * Currently the Values show "Sum of Likes" and "Sum of followers," and we want to change both of these Values to Average (since we want to find the average Followers and Likes)* Give consistent formatting to the numbers so that there are commas in the thousandths place and no decimals* Remove the "(blank)" option* Change the layout of the PivotTable to the "Classic PivotTable layout"
More Episodes
When you think of your data warehouse, the "semantic layer" may not be the first thing that pops in your mind. Prior to reading Frances O'Rafferty's blog post on this topic, I didn't even know this was a concept that mattered in the data stack. To be honest, the concept is still a bit confusing...
Published 09/10/24
Published 09/10/24
If you could only learn one programming language for the rest of your career, what would be it be? You could Google the most popular programming languages and just pick the one of the top 3 and off you go (FYI they are Python, C++, and C). Or, you could pick measly #10 and build a thriving career...
Published 08/05/24