Power BI Dynamic Icon Image based on condition (New Card Visual)

Power BI Dynamic Icon Image based on condition (New Card Visual)

No alt text provided for this image


Did you know you can dynamically show images based on the numerical values with the new card visual.



No alt text provided for this image

Created this whole KPI bar above using only two card visuals. One for the top KPIs, and the second for YoY with arrow icon and PY.


It is a basic chart, but to get dynamic Icon Images this is what I did.

No alt text provided for this image

Went to iconscout.com,

1. select the icon

2. modify it according to need

3. download it and save it in google drive.

4. copy the link and make sure sharing is allowed to anyone with the link.


Icon link would be something like this: "https://drive.google.com/file/d/1urxMtx5fWw1pnUBNYdfytLSVymwTd9v3/view?usp=drive_link"

But to be able to call this icon in power bi, we need to modify it.

"https://drive.google.com/thumbnail?id="

After "https://drive.google.com/thumbnail?id=", add the bold part of the icon link and it then can be utilized as an image url as shown below:

"https://drive.google.com/thumbnail?id=1urxMtx5fWw1pnUBNYdfytLSVymwTd9v3"

"https://drive.google.com/uc?id=" & "19NwqV6qGI--6wlD8kaTtzpcU_tCLI85H"
Claims YoY Symb = 

VAR OrangeUP = "19NwqV6qGI--6wlD8kaTtzpcU_tCLI85H"
VAR BlueDown = "1oK3hJz0dsoyf15qoUB_DrkO5q9SjvqC_"
VAR Result = 
? ? if(
? ? ? ? Pct>=0, 
? ? ? ? "https://drive.google.com/thumbnail?id=" & OrangeUP,
? ? ? ? "https://drive.google.com/thumbnail?id=" & BlueDown
? ? )


RETURN
? ? Result"        
No alt text provided for this image


Make sure to mark the measure as an image url


Select the required series for which you want to apply this image for, go to image section and select this measure for Symb inside of image url field.

No alt text provided for this image


Similarly, conditional formatting on the accent bars can be applied as well and it will help creating a KPI indictor without having to use any other measures or external links.

Hope it helps and opens up new possibilities for your scenarios.






Anna Koeman

Power BI Developer | Trainer | Senior Data Analyst | Microsoft Data & AI Professional | Proces Optimization | Data Visualization

1 年

This type of KPI card is what im looking for, so thanks for your tutorial. I have an additional question, there is 3 numbers per tile. In your article you say that you used 2 card visuals. One for the main numbers at the top and one for the YoY and arrow. How did you do the absolute values (the ones with PY) in the bottom row?

Shadab Khan

Programmer Analyst-ProcDNA | IIMB | Ex-Data Analyst-Turacoz | MSc-Data Science-Symbiosis | Power Bi Certified | DP-600 Fabric & DP-203 Azure Certified | Tableau Certified

1 年

You can do this with unichar code also.

回复

要查看或添加评论,请登录

Syed Ahmed Ali ???? ????的更多文章

  • Power BI Dynamic Top N (Include Others) using Parameter

    Power BI Dynamic Top N (Include Others) using Parameter

    A few months ago, I worked with a client who had a unique requirement: they needed a filter that could dynamically…

    10 条评论
  • A Comprehensive Guide to Power BI Error Bars

    A Comprehensive Guide to Power BI Error Bars

    Introduction Error bars are essential for visualizing data variability and uncertainty, making them invaluable for more…

    5 条评论
  • Mastering Power BI DAX: IsInScope

    Mastering Power BI DAX: IsInScope

    When working with hierarchies in Power BI, managing totals and granular levels can be challenging. One function that…

    7 条评论
  • Power BI: Highlighting Selected Items

    Power BI: Highlighting Selected Items

    Highlighting specific items in Power BI is a powerful way to enhance data analysis, especially when comparing these…

  • Power BI Dynamic Formatting Trick

    Power BI Dynamic Formatting Trick

    Sharing a cool trick I have been using for dynamic formatting in Power BI which I don't see many people use, and it is…

  • Power BI Custom Label Trick (Dynamic Selection)

    Power BI Custom Label Trick (Dynamic Selection)

    In the realm of data visualization, the utilization of custom labels has unlocked a myriad of possibilities. However, a…

  • Distribution Chart Power BI with Gradient Color Using Dax

    Distribution Chart Power BI with Gradient Color Using Dax

    This is simply the combination of Matrix and Scatter plot in Power BI. Problem To create this scatter plot, need…

    2 条评论
  • Power BI Highlighted line based on selection

    Power BI Highlighted line based on selection

    Colors are a powerful tool in visual communication, but too much of a good thing can be overwhelming. This is…

    6 条评论
  • PowerBI Left-Anti Join using DAX(Dynamic)

    PowerBI Left-Anti Join using DAX(Dynamic)

    You can directly use left-anti join in power query, but it won't change with selection on filter. I came across a…

  • PowerBI Legends through formatted text

    PowerBI Legends through formatted text

    Text is the most under utilized tool in visuals. Few days ago I saw a post by Christopher Chin where is showed a unique…

    17 条评论

社区洞察

其他会员也浏览了