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

Calling all Data Engineers! Fabric Data Engineer (Exam DP-700) live sessions are back! Starting October 16th. Sign up.

Reply
ShawnPrice
Helper I
Helper I

Conditional formatting for time

I"m looking for a way to do a conditional format on the table below. I have users who log in each day of the week. If they log in after 8:05:00 AM I want that day to highlighted in a Red.   Step 2 If possible then do a count of how red squares I have for that user.


23-Mar      24-Mar               25-Mar      26-Mar        27-Mar       30-Mar       31-Mar

8:15:00 AM 8:00:00 AM 8:01:00 AM 8:00:00 AM 7:59:00 AM 8:11:00 AM 7:56:00 AM

1 ACCEPTED SOLUTION
Anonymous
Not applicable

@ShawnPrice 
Try follow the steps:

1. In query editor, select the two columns and then unpivot: 

unpivot.JPG

 

2. Close apply, create a flag measure

 

flag = IF(SUM('Table'[Value])>TIMEVALUE("8:05:00"),1,0)

 

 

3. Create a conditional format for Value column, rule by the flag measure

rule by flag.JPG

result color font.JPG

Paul Zheng _ Community Support Team
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

7 REPLIES 7
Anonymous
Not applicable

@ShawnPrice 
Try follow the steps:

1. In query editor, select the two columns and then unpivot: 

unpivot.JPG

 

2. Close apply, create a flag measure

 

flag = IF(SUM('Table'[Value])>TIMEVALUE("8:05:00"),1,0)

 

 

3. Create a conditional format for Value column, rule by the flag measure

rule by flag.JPG

result color font.JPG

Paul Zheng _ Community Support Team
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

So it worked for a few of the times & users before 8:06, you can see some of them are working. Not sure why that would be, The Time fieid is a Time Data Type.Annotation 2020-06-03 081623.png

 

 

Anonymous
Not applicable

@ShawnPrice 

This is strange, only 6:34:00 AM gets wrong value, I have spent sometime on creating a few samples and did not met that issue. I will follow up when I figure it out. And please leave a update if you fixed it too.

 


Paul Zheng _ Community Support Team
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
  

amitchandak
Super User
Super User

@ShawnPrice , Try that you can create a color measure for that and try conditional formatting using a measure

https://radacad.com/dax-and-conditional-formatting-better-together-find-the-biggest-and-smallest-num...
https://docs.microsoft.com/en-us/power-bi/desktop-conditional-table-formatting#color-by-color-values

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube
Greg_Deckler
Community Champion
Community Champion

@ShawnPrice - Is your time an actual date/time or text? If it is actual date/time, then it is really a decimal number of 1/24/60/60 essentially and you could set you parameters accordingly.



Follow on LinkedIn
@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
DAX For Humans

DAX is easy, CALCULATE makes DAX hard...

The Data Type is Time, the Format is h:nn:ss AM/PM

@ShawnPrice - OK, then your threshold should be .33680555555555556. That is 1/24/60 * (8 * 60 + 5)



Follow on LinkedIn
@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
DAX For Humans

DAX is easy, CALCULATE makes DAX hard...

Helpful resources

Announcements
FabCon Global Hackathon Carousel

FabCon Global Hackathon

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

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

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.