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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

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
July 2025 community update carousel

Fabric Community Update - July 2025

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

July PBI25 Carousel

Power BI Monthly Update - July 2025

Check out the July 2025 Power BI update to learn about new features.