NBA style Shot Charts in Power BI

Recently, I created a NBA shot chart in Power BI as part of my entry to the Microsoft Power BI Best report contest and I had got a lot of questions on how I made the visual. So I decided to write a quick post on how I made the shot chart as well as use this opportunity to present my entry, which got selected as one of the Top 10 finalists in the contest.

Note

My interactive contest entry is embedded in this post (thanks to the new Publish to Web feature in Power BI) and a full screen version of the same report can be obtained from here.

My entry is an analysis of the first 35 games played by Stephen Curry from the Golden State Warriors in NBA. The main feature of the entry is a Shot chart which shows the position from which he attempted his shots and the color denotes whether he made or missed it.

1 Shot Chart

To make a similar shot chart, follow the steps below:-

1) The most important part of any report is getting the data. I had a few sources for my data (www.nbastats.comwww.nbasavant.comwww.datavizdoneright.com) from where I directly got my (X,Y) position data. But if you are really serious, you might want to look at the following blog posts which show how to scrape data directly –

How to create NBA Shot Charts in R

How to create NBA Shot charts in Python

2) Once you get your (X,Y) location data, you can import the results into Power BI and then create a scatter chart from the data.

2 Scatter chart

3) Get a background image for the basketball court (I used one that I found from  www.datavizdoneright.com since it had the logo of Golden State Warriors and looked nice). Now you can import the image and place it behind the scatter chart. Make sure that you send the image to the back, as you need the scatter chart on top so that you can interact with the dots by clicking.

3 Arrange

4) Now the hard part is resizing the scatter chart to the size of the court. I turned off the X and Y axis, and then turned on the X,Y reference lines so that I know where the center needs to be.

4 Resizing court

5) Once you have found the right fit, you can turn off the reference lines also and then add the shot result to differentiate between made and missed attempt. You can also add a chiclet slicer with the opponent images to see the shots by teams as shown below.

4 Final shot chart

That said, there is already a custom visual called the Enhanced Scatter Plot which allows you to put an image behind a scatter plot chart. I couldn’t make my data line up with the image, and hence I had to do it the hard way. You might find it easier to use the Enhanced scatter plot directly. Hope you liked my version of the shot chart!

Posted by SQLJason

11 comments

[…] Jason Thomas shows us how to create an NBA-style shot chart using Power BI: […]

This is awesome Jason. Thank you for sharing. I will go vote for you.

@Jack: Thanks a lot for the support :)…

Very interesting . Good idea

Great Jason. I think is the best work of all them: clean design, useful and clear information. My vote for you!!

Really cool stuff! I voted for you. I hope you can post a large version of the report 🙂

[…] that you need Power BI. Just look at this amazing stuff you can do with it. Seriously, go over to Jason Thomas’ site and check it […]

WOW, THIS IS SO AMAZING!!

HOPE YOU KEEP IT UP WITH THE NBA THEME!

[…] raporttiin Lisätietoja raportista: NBA style Shot Charts in Power BI Toteuttaja: Jason […]

[…] A inspiração para este post veio do blog do Jason Thomas, que criou no Power BI um mapa dos arremessos do jogador de basquete Stephen Curry durante alguns jogos da NBA (vale a pena dar uma olhada clicando aqui). […]

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.