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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
Thiagops
Helper II
Helper II

Conditional formatting

Good afternoon,

 

Guys, on my panel I have a card with the shipping separation media.

I would like to put color conditional formatting on this card

 

I tried using the formula below, but it doesn't work. Imagine it's because of the HH MM SS format

SWITCH(
TRUE(),
[Media (Tempo total)] <= 00:05:00, "#65B8FF",
[Media (Tempo total)] > 00:05:00, "#FA495B",
"#666666") 

3 REPLIES 3
tamerj1
Super User
Super User

Hi @Thiagops 

please try

SWITCH(
TRUE(),
[Media (Tempo total)] <= 500, "#65B8FF",
[Media (Tempo total)] > 500, "#FA495B",
"#666666") 

MattAllington
Community Champion
Community Champion

Assuming your column/measure returns time format, you need to use TIME(0,5,0)



* Matt is an 8 times Microsoft MVP (Power BI) and author of the Power BI Book Supercharge Power BI.
I will not give you bad advice, even if you unknowingly ask for it.

I used as below, but it didn't work

Cor (A caminho) =
SWITCH(
TRUE(),
[TMS pedido] <= TIME(0,10,0), "#65B8FF",
[TMS pedido] > TIME(0,10,0), "#FA495B",
"#666666")

 

 

TMS pedido =
var Tempo = AVERAGE(PEDIDO_VENDA[Temp_Total (2)])
var Horas = INT(Tempo / 3600)
var Minutos = INT((Tempo - (Horas * 3600)) / 60)
var Secundos = MOD(Tempo, 60)
return
IF((Horas * 10000 + Minutos * 100 + Secundos) = BLANK(),
0,
(Horas * 10000 + Minutos * 100 + Secundos))

The result of the requested TMS is at 00:00:00

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.