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
ADSL
Post Prodigy
Post Prodigy

Getting Min & Max Time in different Time Group

Hi BI Community Team,

 

I have a table name "VISIT SUMM" that it has a record login and logout time of each sales rep and customer visited. 

 

In daily basic, we want to track the sales rep punch time -- min & max time with different time group below.

 

2023-07-10_14-23-10.png

 

Any suggestion/advise?

 

Thanks and Regards,

2 REPLIES 2
lbendlin
Super User
Super User

Time_Session = SWITCH(TRUE(),
[TIME_IN] >= TIME(1,0,0) && [TIME_IN] < TIME(8,0,0), "Early Morning",
[TIME_IN] >= TIME(8,0,0) && [TIME_IN] < TIME(12,0,0), "Morning",
[TIME_IN] >= TIME(12,0,0) && [TIME_IN] < TIME(13,0,0), "Lunch",
[TIME_IN] >= TIME(13,30,0) && [TIME_IN] < TIME(17,30,0), "Afternoon",
[TIME_IN] >= TIME(17,30,0) && [TIME_IN] < TIME(21,0,0), "Evening", "Late Evening")

- The lunch interval is incorrect.

- [TIME_IN]  is a datetime value so all your Time_Session computations result in "Late Evening". Did you mean to use [Log_In]  ?

 

lbendlin_0-1689127631806.png

see attached

 

 

Hi @lbendlin,

When we build visual with matrix, then getting wrong result between time session as the screenshot below.

 

e.g. Morning - 8h00 till 11h59

 

Please help to check and advise.

 

2023-07-12_09-43-15.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.

Users online (1,922)