Forum Discussion

mehupbi's avatar
mehupbi
Frequent Visitor
2 years ago
Solved

Multi card or multi tile visual with conditional colors applied

I have a data which is posted below,

https://filetransfer.io/data-package/a4zPdp0L#link

colors logics should be 


IF [Trend green]="Positive" AND [ValueVsTarget]>=0 THEN "Green"
ELSEIF [Trend green]="Positive" AND [ValueVsTarget]<0 THEN "Red"
ELSEIF [Trend green]="Negative" AND [ValueVsTarget]<=0 THEN "Green"
ELSEIF [Trend green]="Negative" AND [ValueVsTarget]>0 THEN "Red"
ELSEIF [Trend green]="White" THEN "White"
ELSEIF [Trend green]="Grey" THEN "Grey"
END

i tried card, kpi e.t.c visuals to get the below output but unfortunately not happened.

I want to achieve,

 

Please help me how to achieve this kind of Visual in PBI with the data provided

 

Thanks in advance.


  • Anonymous's avatar
    Anonymous
    2 years ago

    Hi mehupbi ,
    Based on your description, power bi really can't generate such an effect from a visual object. But you can do it by using a custom color for the card visual object. Here is the brief procedure
    Here is my test data:

    Create a column

    Color = 
    VAR _ValueVsTarget = [Sum of Value] - [Target]
    RETURN
    SWITCH(
        TRUE(),
        [Trend_green] = "Positive" && _ValueVsTarget >= 0 , "Green",
        [Trend_green] = "Positive" && _ValueVsTarget < 0 , "Red",
        [Trend_green] = "Negative" && _ValueVsTarget >= 10 , "Blue",
        [Trend_green] = "Negative" && _ValueVsTarget > 0 , "Red",
        [Trend_green] = "Negative" && _ValueVsTarget <= 0 , "Green",
        [Trend_green] = "White" , "White",
        [Trend_green] = "Grey" , "Grey"
    )

    Create measures to fill the card

    Service Level = 
    CALCULATE(
        SUM('Table'[Sum of Value])/SUM('Table'[Target]),
        FILTER(
            'Table',
            'Table'[Metric] = "Service Level"
        )
    )
    Cost = 
    CALCULATE(
        SUM('Table'[Sum of Value]),
        FILTER(
            'Table',
            'Table'[Metric] = "Cost"
        )
    )

    Create a measure to get the corresponding color

    Color_Cost = 
    CALCULATE(
        MAX('Table'[Color]),
        FILTER(
            'Table',
            'Table'[Metric] = "Cost"
        )
    )
    Color_Service Level = 
    CALCULATE(
        MAX('Table'[Color]),
        FILTER(
            'Table',
            'Table'[Metric] = "Service Level"
        )
    )

    Go to General->Effects->Background



    Create as many cards as you need

    Final output

    Best regards,
    Albert He

    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly

     

     



     

3 Replies

  • Anonymous's avatar
    Anonymous
    Not applicable

    Hi mehupbi ,
    Based on your description, power bi really can't generate such an effect from a visual object. But you can do it by using a custom color for the card visual object. Here is the brief procedure
    Here is my test data:

    Create a column

    Color = 
    VAR _ValueVsTarget = [Sum of Value] - [Target]
    RETURN
    SWITCH(
        TRUE(),
        [Trend_green] = "Positive" && _ValueVsTarget >= 0 , "Green",
        [Trend_green] = "Positive" && _ValueVsTarget < 0 , "Red",
        [Trend_green] = "Negative" && _ValueVsTarget >= 10 , "Blue",
        [Trend_green] = "Negative" && _ValueVsTarget > 0 , "Red",
        [Trend_green] = "Negative" && _ValueVsTarget <= 0 , "Green",
        [Trend_green] = "White" , "White",
        [Trend_green] = "Grey" , "Grey"
    )

    Create measures to fill the card

    Service Level = 
    CALCULATE(
        SUM('Table'[Sum of Value])/SUM('Table'[Target]),
        FILTER(
            'Table',
            'Table'[Metric] = "Service Level"
        )
    )
    Cost = 
    CALCULATE(
        SUM('Table'[Sum of Value]),
        FILTER(
            'Table',
            'Table'[Metric] = "Cost"
        )
    )

    Create a measure to get the corresponding color

    Color_Cost = 
    CALCULATE(
        MAX('Table'[Color]),
        FILTER(
            'Table',
            'Table'[Metric] = "Cost"
        )
    )
    Color_Service Level = 
    CALCULATE(
        MAX('Table'[Color]),
        FILTER(
            'Table',
            'Table'[Metric] = "Service Level"
        )
    )

    Go to General->Effects->Background



    Create as many cards as you need

    Final output

    Best regards,
    Albert He

    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly

     

     



     

  • mehupbi's avatar
    mehupbi
    Frequent Visitor

    Let me try and will accept solution once i get my required result

    • Anonymous's avatar
      Anonymous
      Not applicable

      Hi mehupbi ,
      Did this method help you? If there are any other questions related to this post, you can reply below.

      Best regards,
      Albert He

      If this post helps, then please consider Accept it as the solution to help the other members find it more quickly