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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
Fbnt
Frequent Visitor

Map chart, how to use condition based formatting for values? Individual per city

Hello together!

 

I took over an PowerBI report, where I now want to change the map-chart.

There are different cities, and based on the value of the city, the city-dot gets green, yellow or red. 

Currently defined green >80%, yellow >60%, red <60%. But I can't see where this has been set. In the normal formatting overview it's not visible.

 

I want to change that, so that each city has it's own individual target when it gets which color (green, yellow or red color).

For example city1, if >50% = green. <30% = red. And so on.

How can I do that?

 

Thanks in advance! 🙂 

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

Hi @Fbnt ,

In your formula, as the value of City "X" is 37.5% and it meet the standard of yellow, which is less than 0.55, so it shows yellow, you can modify it like this:

Measure = 
SWITCH (
    TRUE (),
    MAX ( all_mes_join[Site / Center] ) = "X"
        && MAX ( 'all_mes_join'[OEE] ) >= 0.55, "Green",
    MAX ( all_mes_join[Site / Center] ) = "X"
        && MAX ( all_mes_join[OEE] ) >= 0.4
        && MAX ( all_mes_join[OEE] ) < 0.55, "Yellow",
    MAX ( all_mes_join[Site / Center] ) = "X"
        && MAX ( all_mes_join[OEE] ) < 0.40, "Red",
    "Purple"
)

vkalyjmsft_0-1638786962181.png

I attach my sample below for reference.

Best Regards,
Community Support Team _ kalyj

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

4 REPLIES 4
v-yanjiang-msft
Community Support
Community Support

Hi @Fbnt ,

In your formula, as the value of City "X" is 37.5% and it meet the standard of yellow, which is less than 0.55, so it shows yellow, you can modify it like this:

Measure = 
SWITCH (
    TRUE (),
    MAX ( all_mes_join[Site / Center] ) = "X"
        && MAX ( 'all_mes_join'[OEE] ) >= 0.55, "Green",
    MAX ( all_mes_join[Site / Center] ) = "X"
        && MAX ( all_mes_join[OEE] ) >= 0.4
        && MAX ( all_mes_join[OEE] ) < 0.55, "Yellow",
    MAX ( all_mes_join[Site / Center] ) = "X"
        && MAX ( all_mes_join[OEE] ) < 0.40, "Red",
    "Purple"
)

vkalyjmsft_0-1638786962181.png

I attach my sample below for reference.

Best Regards,
Community Support Team _ kalyj

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

Fbnt
Frequent Visitor

@amitchandak :

I have it now almost in place. There is one last error + I have 1 question:

  1. The errror: The value for City "X" = 37.5% and it's not showing the correct color. It shows yellow color, but it must be red color. Whats the issue?
  2. Question: How can I say in the measurement "equals or bigger then"?

 

 

My measure:

 

Switch( True() ,

max(all_mes_join[Site / Center]) ="X" && all_mes_join[OEE] >.55 , "Green",

max(all_mes_join[Site / Center]) ="X" && all_mes_join[OEE] <.55 , "Yellow",

max(all_mes_join[Site / Center]) ="X" && all_mes_join[OEE] <.40 , "Red",
 
 
Thanks!
amitchandak
Super User
Super User

@Fbnt , You need to create a color measure and use that is conditional formatting and with field value option

 

 

Switch( True() ,

max(Table[City]) ="City1" && [Measure] >.5 , "Green",

max(Table[City]) ="City1" && [Measure] <.3 , "Red",

max(Table[City]) ="City2" && [Measure] >.6 , "Green",

/// add other

"Red"

)

 

 

conditional formatting by measure and apply it on pie?: https://youtu.be/RqBb5eBf_I4

This one worked for me to get the coloring right:

 

OEE-color weekly = Switch( True() ,

max(v_mes_powerbi_weekly[Site / Center]) ="1" && average(v_mes_powerbi_weekly[OEE]) >=.5 , "Green",
max(v_mes_powerbi_weekly[Site / Center]) ="1" && average(v_mes_powerbi_weekly[OEE]) <.5 && average(v_mes_powerbi_weekly[OEE]) >.35, "Yellow",
max(v_mes_powerbi_weekly[Site / Center]) ="1" && average(v_mes_powerbi_weekly[OEE]) <=.35 , "Red",
/// add other

"grey"

)

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

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

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.