Forum Discussion

ahmedshalabyy12's avatar
6 months ago
Solved

Table Highlight in Desktop

Hello,

How can I do a highlight like this in table?

 

  • hello ahmedshalabyy12 

     

    Natarajan_M is straightforward which you can try it first.

    as pcoley said, this should be possible by using svg.

     

    however, this is a workaround if you want to have those customized icon instead of font and background color as explained by Natarajan_M and without using SVG as explained by pcoley .

    1. put all your customized image icon in a folder (you can do a local folder).

    2. import those image to power bi (get data->folder). then define the image which for what condition.

    3. transform that image into base64

    = Table.AddColumn(#"Removed Other Columns", "Custom", each "data:image/png;base64, " & Binary.ToText([Content], BinaryEncoding.Base64))

    4. import to power bi

    5. create a calculated column to calculate the base64 code based on your fact table condition and DONT forget to change data category into Image URL.

    Image =
    MAXX(
        FILTER(
            'IMG',
            'Table'[Promo Tier]='IMG'[Condition]
        ),
        'IMG'[Custom]
    )
    6. plot into table visual

     

    Hope this will help.

    Thank you.

5 Replies

  • Hi ahmedshalabyy12  , We can recreate this using the conditional formatting in power bi .

    Sample Data :


    Measures : we are going to create a measure to get the currentvalue of the promo and discount and based on the value it will show the background and font color

    Measures for Background color :

    Promo Tier BG =
    SWITCH(
        SELECTEDVALUE(Pricing[Promo Tier]),
        "Flash Sale", "#F8D7DA",
        "Standard", "#FFF3CD",
        "No Promo", "#E2E3E5",
        "#FFFFFF"
    )

    Status BG =
    SWITCH(
        SELECTEDVALUE(Pricing[Status]),
        "Undercut", "#F8D7DA",
        "Competitive", "#D1E7DD",
        "Watch", "#FFF3CD",
        "#FFFFFF"
    )

    for Font :
    Promo Tier Font =
    SWITCH(
        SELECTEDVALUE(Pricing[Promo Tier]),
        "Flash Sale", "#842029",
        "Standard", "#856404",
        "No Promo", "#0D6EFD",
        "#000000"
    )
    Status Font =
    SWITCH(
        SELECTEDVALUE(Pricing[Status]),
        "Undercut", "#842029",
        "Competitive", "#0F5132",
        "Watch", "#856404",
        "#000000"
    )
    Sample Visual :


    Thanks 

    If this response was helpful in any way, I’d gladly accept a kudo.
    Please mark it as the correct solution. It helps other community members find their way faster





  • hello ahmedshalabyy12 

     

    Natarajan_M is straightforward which you can try it first.

    as pcoley said, this should be possible by using svg.

     

    however, this is a workaround if you want to have those customized icon instead of font and background color as explained by Natarajan_M and without using SVG as explained by pcoley .

    1. put all your customized image icon in a folder (you can do a local folder).

    2. import those image to power bi (get data->folder). then define the image which for what condition.

    3. transform that image into base64

    = Table.AddColumn(#"Removed Other Columns", "Custom", each "data:image/png;base64, " & Binary.ToText([Content], BinaryEncoding.Base64))

    4. import to power bi

    5. create a calculated column to calculate the base64 code based on your fact table condition and DONT forget to change data category into Image URL.

    Image =
    MAXX(
        FILTER(
            'IMG',
            'Table'[Promo Tier]='IMG'[Condition]
        ),
        'IMG'[Custom]
    )
    6. plot into table visual

     

    Hope this will help.

    Thank you.