英文:
Creating a Music Podium top 5 - like visualization in Power BI from a table
问题
我面临创建Power BI中的音乐可视化的挑战,我已经创建了DAX代码,生成了一个表格,其中排名前5的歌曲,包括艺术家的名称以及歌曲是否正在趋势上升(up),正在下降(down)或保持位置不变(hold)。
输出表格如下:
歌曲 | 位置 | 艺术家 | 趋势 | 可视化图像 |
---|---|---|---|---|
快乐旋律 | 1 | 亚历克斯·吉布斯 | 上升 | x.jpg |
旋律 | 2 | 阿曼达·S. | 保持 | y.jpg |
只有你 | 3 | B,Y.I | 上升 | z.jpg |
今晚与Y-R-U | 4 | Lory & Y-R-U | 保持 | i.jpg |
绿色草地 | 5 | 杰克·希尔 | 下降 | m.jpg |
您会注意到我还有一个用于.jpg图像的列,我需要创建类似下面的东西:
我希望创建一个透明的表格,以便我可以上传我需要创建顶部排行榜前5视觉化所需的图像。我已经查看了许多Power BI库,似乎找不到我期望的视觉化或接近它的东西,由衷感谢,如果您知道如何做到这一点,我将永远感激不尽,还请知道,我将非常关注并投票选出最佳答案,非常感谢各位。
英文:
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 postion 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 maintaning 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 top5 viz above I have gone through so many power bi libraries and i cant seem to find my desired viz or something close to it, from the bottom of my heart thank you so much if you know how to do this I will be forever thankful, also please know that I will be super attentive to upvote and select the best answer thank you so much guys
答案1
得分: 1
你有两种解决方法:
-
使用 Deneb 自定义可视化。如果你对 Vega 不太熟悉,这可能有点复杂,但并不难。
-
使用本机可视化的组合。由于你只有 5 个数据点,不会增加或减少,你可以为你的数字布局 5 张图像。然后,在每个图像旁边插入一个文本框,其中包含特定排名歌曲和艺术家的度量值。对于你的上下箭头图标,你可以再次插入带有箭头和圆圈的形状。你在每一行都插入上下箭头图标,并通过 DAX 控制不透明度。也就是说,除非你的度量值指示应该上升或下降,否则一切都是透明的。
编辑:如何操作。
-
插入图像
-
为歌曲创建一个度量值,如下所示:
1song = CALCULATE( MIN('Table'[song]), 'Table'[position] = 1)
-
为艺术家创建一个度量值,如下所示:
1artist = CALCULATE( MIN('Table'[artist]), 'Table'[position] = 1)
-
在数字旁边插入一个文本框,并在文本框中包含这两个新度量值。
-
插入两个箭头,并关闭它们的边框,一个设为绿色,一个设为红色。
-
创建一个度量值,如下所示:
1green = IF( CALCULATE( MIN('Table'[trend]), 'Table'[position] = 1) =="up","green", "#00000000" )
-
再创建一个度量值:
1red = IF( CALCULATE( MIN('Table'[trend]), 'Table'[position] = 1) =="down","red", "#00000000" )
-
高亮显示绿色箭头,在格式设置窗格中选择填充和 fx 按钮。设置如下:
-
对红色箭头和度量值执行相同操作。
-
就这样。对其他位置重复 5 次。
最终结果:
英文:
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.
- Insert an image
-
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:
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论