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

The Power BI Data Visualization World Championships is back! It's time to submit your entry. Live now!

Reply
Anonymous
Not applicable

Classification between times

Hello, i'm having trouble making a column that returns T1 T2 or T3 depending on wich time it was made

 

From 00:00 to 5:59 T3

         6:00 to 13:59 T1

         14:00 to 21:59 T2

         22:00 to 23:59 T3

         

Maybe someone can give me a light?

 

Thanks in advance !! 🙂

1 ACCEPTED SOLUTION
camargos88
Community Champion
Community Champion

Hi @Anonymous ,

 

Try this code to create a calculated column:

 

Column =
VAR _time = TIME(HOUR('Table (2)'[Column1]);MINUTE('Table (2)'[Column1]); SECOND('Table (2)'[Column1]))

RETURN IF(_time >= TIME(0;0;0) && _time <= TIME(5;59;0); "T3";
IF(_time >= TIME(6;0;0) && _time <= TIME(13;59;0); "T1";
IF(_time >= TIME(14;0;0) && _time <= TIME(21;59;0); "T2";
IF(_time >= TIME(22;0;0) && _time <= TIME(23;59;0); "T3"))))
 
Ricardo


Did I answer your question? Mark my post as a solution!

Proud to be a Super User!



View solution in original post

2 REPLIES 2
camargos88
Community Champion
Community Champion

Hi @Anonymous ,

 

Try this code to create a calculated column:

 

Column =
VAR _time = TIME(HOUR('Table (2)'[Column1]);MINUTE('Table (2)'[Column1]); SECOND('Table (2)'[Column1]))

RETURN IF(_time >= TIME(0;0;0) && _time <= TIME(5;59;0); "T3";
IF(_time >= TIME(6;0;0) && _time <= TIME(13;59;0); "T1";
IF(_time >= TIME(14;0;0) && _time <= TIME(21;59;0); "T2";
IF(_time >= TIME(22;0;0) && _time <= TIME(23;59;0); "T3"))))
 
Ricardo


Did I answer your question? Mark my post as a solution!

Proud to be a Super User!



Anonymous
Not applicable

It worked ! Thanks a lot Ricardo, God Speed

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! It's time to submit your entry.

January Power BI Update Carousel

Power BI Monthly Update - January 2026

Check out the January 2026 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.