Dunking on current NBA player statistics with Tableau
Michael Whaley
Data Analyst | Transforming Data into Insights with SQL, Tableau, and Visualization Expertise.
Confession, I don't follow NBA basketball at all. I played organized basketball for many years growing up and have always loved the game. The first time I remember hearing a misleading player statistic was on a bus returning from an away game. The score keeper asked us to guess the player on our team with the highest field goal percentage. Of course most of us guessed our best player. Nobody guessed correctly since it was a backup player who had only taken two shots making both of them for a field goal percentage of 100%!
Why THIS Project?
I chose this project to sharpen my data visualization skills with Tableau while diving into a subject that I used to know, basketball. With a messy text file to start with there was also an opportunity to practice some advanced Excel skills too!
Key Takeaways
Dataset Details
The data set from basketball reference is a .csv text file of the current season's player statistics in the NBA as of January 29, 2025. After cleaning I ended up with 525 rows and 31 columns.
Analysis Process
After downloading the data I converted to Excel format and noticed some players repeating. The repeating players have played for two teams this season and for this analysis we want their total statistics represented on their current team not 2TM which is not a real team.
To start, I added a column for a Boolean value to highlight and sort the repeaters with this formula that basically tells Excel to search column B and if the value of B2 shows up more than 1 time highlight it, "=COUNTIF(B:B, B2) > 1". After applying the formula to the whole column I ended up with the result below.
Which real team does the player currently play for? I checked several players and found it was always the third entry in this list. I replaced the 2TM with the current team by adding a new column called current team and using a formula that checks if the value is 2TM then replaces it with the value two rows down as shown below.
The team is now changed but there are still three entries for these players. To get rid of the duplicate player entries I created another player column and used a formula to again count how many times Excel finds a name and change it to an empty cell.
Then filter to select empty cells in that column and delete them.
The Excel file is now ready for Tableau.
Visualization
I started by creating a heat map table on 3pt% by position per team. Mathematically, you cannot use the average of the averages, instead manually create a formula for Tableau "SUM([3P])/SUM([3PA])" in both the value and the color to get this result
领英推荐
We can quickly see that Cleveland's Center has a 0% 3P% while Dallas's has a 100%! If further analysis was desired on this statistic some parameters would need to be added like a minimum attempts (3PA) for example.
Next I decided to graph players points, assists, and total rebounds by position on a bubble chart. I used PTS as the column, AST as the row and TRB as the size of the bubble.
It appears the best all around player is Nikola, a center. Overall it seems centers get the most total rebounds and point guards score the most points while assists are a mixed bag.
Next I created a stacked bar chart of points per team and per player on each team. The columns represent teams, the rows points, and the colors differentiate players. I sorted the teams and players by points in descending order. Initially, it appeared there were teams that had players that scored most of the points. Look at Collin Sexton from Utah below, I=it lools like he scores most of the points.
It turns out he doesn't. I hovered over him and realized he and the two players below him are the same color in the stacked bar so I added a border.
I need to do a deep dive on Tableau's behavior here to find out if there is a way to force colors to not be side by side. For now, the border is effective.
Next, a tree map on assists by position. Color is used to differentiate positions and borders per player.
Finally, I wrapped it all up in a Tableau Story. The ability to add captions and allow the user to scroll through each visualization one at a time is a great feature of Tableau stories.
Main Takeaways
Conclusion
Throughout this project, I learned the importance of focusing on the questions stakeholders are asking and clarifying if more analysis should be done in particular areas to eliminate misleading metrics.
This project has improved my Data Visualization skills, and has piqued my curiosity into how NBA player and team stats could before a head to head matchup!
I’d love to hear your thoughts on this project! Please leave a comment with your insights or questions. If you or someone you know is looking to hire a data analyst, let’s connect—I’m excited to explore new opportunities! Let's connect!
This looks so confusing. ??
Freelance Data Analyst ? Business Intelligence Specialist ? BI Consultant ? BI Developer ? Data Scientist
1 个月Data analytics with collaboration of NBA ?? perfection ??
?? I help people land their first data job (even with no experience) ?? Join 10k+ other analysts & get my newsletter! ??? Host of The Data Career Podcast
1 个月?? nice work! Love the treemap