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

Next up in the FabCon + SQLCon recap series: The roadmap for Microsoft SQL and Maximizing Developer experiences in Fabric. All sessions are available on-demand after the live show. Register now

Reply
DannyAlfa
Frequent Visitor

Conditional Formatting Time

Hi all,

 

Hope you kind people can help with this, I have a table that I am trying to conditionally format based on time.

 

What I want it to do is show as red should the time be before 11pm and to show green if it is after 11pm (for the times in the centre column). Up to now all I have is a late flag measure to show 1 if the time is before 11pm, my plan was to then format the late flag measure based on the value.

 

You can see from the below screen shot what I have done up to now, any suggestions would be greatly appreciated.

 

DannyAlfa_0-1714655966326.png

 

1 ACCEPTED SOLUTION
PhilipTreacy
Super User
Super User

Hi @DannyAlfa 

 

Download PBIX file with the example below

 

Create a measure

 

Time Colour = IF( SELECTEDVALUE('Till Data'[Time]) < TIMEVALUE("23:00"), "red", "green")

 

In the Conditional Formatting or the Time column use these settings

 

timecf.png

 

 

To give this

 

timecf1.png

 

 

Regards

 

Phil

 



Did I answer your question? Then please mark my post as the solution.
If I helped you, click on the Thumbs Up to give Kudos.


Blog :: YouTube Channel :: Connect on Linkedin


Proud to be a Super User!


View solution in original post

3 REPLIES 3
DannyAlfa
Frequent Visitor

@PhilipTreacy - in fact now I look at it its putting everything as red, which makes me think its something to do with how the time is formatted maybe????

DannyAlfa_0-1714744808562.png

 

DannyAlfa
Frequent Visitor

@PhilipTreacy - Genius, worked a treat 🙂

PhilipTreacy
Super User
Super User

Hi @DannyAlfa 

 

Download PBIX file with the example below

 

Create a measure

 

Time Colour = IF( SELECTEDVALUE('Till Data'[Time]) < TIMEVALUE("23:00"), "red", "green")

 

In the Conditional Formatting or the Time column use these settings

 

timecf.png

 

 

To give this

 

timecf1.png

 

 

Regards

 

Phil

 



Did I answer your question? Then please mark my post as the solution.
If I helped you, click on the Thumbs Up to give Kudos.


Blog :: YouTube Channel :: Connect on Linkedin


Proud to be a Super User!


Helpful resources

Announcements
New to Fabric survey Carousel

New to Fabric Survey

If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.

March Power BI Update Carousel

Power BI Community Update - March 2026

Check out the March 2026 Power BI update to learn about new features.