I am met with the challenge of creating a music visualization in Power BI. I have already created the DAX code to come up with a table that will rank the position of the top 5 songs of the week including the name of the artist and if the song is trending (up), is going down positions (down), or is maintaining its positions (hold).
The output table looks like this:
| song | position | artist | trend | image_for_viz |
|:---------------:|:--------:|:------------:|:-----:|:-------------:|
| Happy Vibes | 1 | Alex Gibbs | up | x.jpg |
| Melodies | 2 | Amanda S. | hold | y.jpg |
| Only You | 3 | B,Y.I | up | z.jpg |
| 2nite ft. Y-R-U | 4 | Lory & Y-R-U | hold | i.jpg |
| Green Grass | 5 | Jake Hill | down | m.jpg |
You will notice I also have a column for the .jpg image I need to create something like this:
I'd like to create a table so transparent and in such a way that I can upload the image that I need to create the topchart top 5 viz above. I have gone through some Power BI libraries and I can't seem to find my desired viz or something close to it. How can I achieve what I want?
You have two options to solve this:
Use Deneb custom visual. This isn't difficult but is a little involved if you're not familiar with Vega.
Use a combination of native visuals. As you only have 5 datapoints which never increase or decrease, you can layout 5 images for your numbers. Then next to each image, insert a text box with a measure for the specific ranked song and artist. For your up/down icons, you again insert shapes with arrows and circles. You insert both an up and down icon on every line and control the opacity through DAX. i.e. everything is transparent unless your measure states it should be up or down.
Edit: How To.
Create a measure for song as follows:
1song = CALCULATE( MIN('Table'[song]), 'Table'[position] = 1)
Create a measure for artist as follows:
1artist = CALCULATE( MIN('Table'[artist]), 'Table'[position] = 1)
Insert a text box next to your number and inside the text box include the two new measures.
Insert two arrows and turn their borders off, making one green and one red.
Create a measure as follows:
1green = IF( CALCULATE( MIN('Table'[trend]), 'Table'[position] = 1) =="up","green", "#00000000" )
And another
1red = IF( CALCULATE( MIN('Table'[trend]), 'Table'[position] = 1) =="down","red", "#00000000" )
Highlight green arrow and in formatting pane, select Fill and the fx button. Complete as follows:
9 Do same for red arrow and measure
10 That's it. Repeat 5 more times for your other positions.
Final result: