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

The Power BI DataViz World Championships are on! With four chances to enter, you could win a spot in the LIVE Grand Finale in Las Vegas. Show off your skills.

Reply
Anonymous
Not applicable

PowerBi KPI traffic light

Hello!
I try to build a "traffic light" my data looks somehow like this:

team branch number_of_incides
1 1 2

1 2 1

2 1 3

2 2 2

 

What I already achived, is that I can set the teams in relation to each other for each branch, so f.e. 
branch 1: team 1: (2/5 - green), team 2: (3/5 - yellow) and branch 2: team 1: (1/3 - green), team 2: (2/3 - red)
But I do not want to set in relation to the occurences of all teams, but to itself, so the specific team.
f.e. branch 1, team 1: (2/3- red), because team 1 has 2 incidents in branch 1 and 1 in branch 2.
But somehow my KPI (unichar with conditional formatting) is to unflexible to achieve that.

 

I would be grateful for any help.

1 ACCEPTED SOLUTION
v-jingzhang
Community Support
Community Support

Hi @Anonymous 

You may try some measure like this for conditional formatting:

Measure = 
VAR _total = CALCULATE(SUM('Table'[Number_of_Incides]),ALLEXCEPT('Table','Table'[Team]))
VAR _value = DIVIDE(SUM('Table'[Number_of_Incides]),_total)
RETURN
SWITCH(TRUE(),_value>=2/3,"Red",_value>=1/3,"Yellow","Green")

040903.jpg

Kindly let me know if this helps.
Community Support Team _ Jing
If this post helps, please Accept it as the solution to help other members find it.

View solution in original post

2 REPLIES 2
v-jingzhang
Community Support
Community Support

Hi @Anonymous 

You may try some measure like this for conditional formatting:

Measure = 
VAR _total = CALCULATE(SUM('Table'[Number_of_Incides]),ALLEXCEPT('Table','Table'[Team]))
VAR _value = DIVIDE(SUM('Table'[Number_of_Incides]),_total)
RETURN
SWITCH(TRUE(),_value>=2/3,"Red",_value>=1/3,"Yellow","Green")

040903.jpg

Kindly let me know if this helps.
Community Support Team _ Jing
If this post helps, please Accept it as the solution to help other members find it.

amitchandak
Super User
Super User

@Anonymous , You can create color and unichar measure and do based on that

Switch( True(),

Sum(Table[number_of_incides]) <= 2, "Green",

"red"

)

 

Use in conditional formatting using field value

 

Refer for unichar and color

https://exceleratorbi.com.au/conditional-formatting-using-icons-in-power-bi/
https://community.powerbi.com/t5/Desktop/FORMAT-icon-set-for-use-in-a-data-card/td-p/811692
https://www.youtube.com/watch?v=veCtfP8IhbI
https://exceleratorbi.com.au/dax-unichar-function-power-bi/

Full Power BI Video 20 Hours YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Prices go up Feb. 11th.

Feb2025 Sticker Challenge

Join our Community Sticker Challenge 2025

If you love stickers, then you will definitely want to check out our Community Sticker Challenge!

Jan NL Carousel

Fabric Community Update - January 2025

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