Introduction
Radar charts have their pros and cons, but they are a great way to learn how to make a chart with an SVG image. Another reason to do this in SVG rather than with a custom visual is that it allows us to simulate small multiples by putting the measure in a table or matrix.
The overall idea was to create a sample SVG radar image, and then recreate it with DAX to be dynamically generated based on measures in Power BI.
To determine the x, y coordinates of the radius lines in the radar chart and the points on the circles, I got to have some fun with math! If you’d like to learn more about how I did it (using sine and cosine), you can find the formula in this precalculus text.
Read more details on our blog.
Requirements
1. Import the data provided for this exercise from Kaggle.
2. Create your base measures
– Avg for each characteristic that you’re interested in (I used 8 – everything except instrumentalness, liveness, and speechiness)
3. Create a table in the DAX measure for the elements you want to show on the radar chart. This helps you control what renders on the chart.
4. Create a calculation group to be able to get various statistics needed for the placement of the values.
– Value, Minimum, Maximum, MaxForRadar, Overall Average, Relative Value, Avg Relative Value
5. Create measures for your radar chart display
6. Create your Radar SVG measure. Feel free to consult the solution file to see what I did here!
– this measure creates a temp table that dictates the row, the measure name, the format of the value, the measure value converted to a percent of the maximum, then, use DAX to create each element of the radar chart. Hint: use CONCATENATEX, SIN, COS, and RADIANS.
7. Create your visuals – 3 ways!
– Use the HTML Content (lite) custom visual
– Create a table that includes the radar chart for easy comparison across categories
– Create a matrix that includes the track numbers
Dataset
This week’s dataset comes from Spotify via Kaggle. Download the data and bring the data into Power BI.
Share
After you finish your workout, share on Twitter using the hashtags #WOW2023 and #PowerBI, and tag @MMarie, @shan_gsd, @KerryKolosko, @StephTBruno. Also make sure to fill out the Submission Tracker so that we can count you as a participant this week in order to track our participation throughout the year.
Solution
Solution File available for download via my GitHub repo.