Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Grow your Fabric skills and prepare for the DP-600 certification exam by completing the latest Microsoft Fabric challenge.

Reply
mehupbi
Frequent Visitor

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,

mehupbi_0-1715856867062.png

 

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

 

Thanks in advance.


1 ACCEPTED SOLUTION
v-heq-msft
Community Support
Community Support

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:

vheqmsft_0-1715913908220.png

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

vheqmsft_1-1715914150824.png

Create as many cards as you need

Final output

vheqmsft_2-1715914167793.png

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

 

 



 

View solution in original post

3 REPLIES 3
mehupbi
Frequent Visitor

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

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

v-heq-msft
Community Support
Community Support

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:

vheqmsft_0-1715913908220.png

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

vheqmsft_1-1715914150824.png

Create as many cards as you need

Final output

vheqmsft_2-1715914167793.png

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

 

 



 

Helpful resources

Announcements
RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

Ask questions in Eventhouse and KQL, Eventstream, and Reflex.

MayPowerBICarousel1

Power BI Monthly Update - May 2024

Check out the May 2024 Power BI update to learn about new features.