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
Ayyappa5678
Helper III
Helper III

Time values for conditional formatting, Kindly help me!

Hi team,

Good Evening!

I have the time values with "00:00" format in table visual(like below snapshot). I need to do conditional formatting like

a) 00:00 to 01:59 with no background color, leave it as it is.

b) 02:00 and remaining all values need to change with background color is red.

Kindly help me please!
Thanks in advance.

Ayyappa5678_0-1704209928949.png

 

1 ACCEPTED SOLUTION
Ayyappa5678
Helper III
Helper III

HighlightTime =
VAR _time = SELECTEDVALUE(Gap[gap])
VAR _timeValue = TIMEVALUE(_time)
VAR _highlight =
IF(
_timeValue >= TIME(0,0,0) && _timeValue < TIME(2,0,0),
0, // no color
1 // red color
)
RETURN _highlight

View solution in original post

4 REPLIES 4
Ayyappa5678
Helper III
Helper III

HighlightTime =
VAR _time = SELECTEDVALUE(Gap[gap])
VAR _timeValue = TIMEVALUE(_time)
VAR _highlight =
IF(
_timeValue >= TIME(0,0,0) && _timeValue < TIME(2,0,0),
0, // no color
1 // red color
)
RETURN _highlight

Ayyappa5678
Helper III
Helper III

Kindly please respond. @Y_S 
@Anonymous 

Y_S
Frequent Visitor

You can create a simple measure, setting highlight to yes/no, then do conditional formatting:

HighlightTime =
 var _time = SELECTEDVALUE('Table'[Column1])
 var _highlight =
    IF(
        _time >= TIME(0,0,0) && _time < TIME(2,0,0)  ,
        0, // no color
        1 // red color
    )
return _highlight

Y_S_0-1704225229456.png
Y_S_1-1704225314548.png

 

 

Thanks for the response,

 

But currently my exiting time column is with text format. 

While doing all the measures and all getting below snapshot error. Kindly please check and do needful pls.

Thanks in advance.

Ayyappa5678_0-1704263111901.png

 

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.