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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Learn more

Reply
Anonymous
Not applicable

How to create time bucket

Hi,

 

Request your guidance to solve  my issue related to time bucket

 

i have a table which contains a field showing  date and time of sales, sales happens in almost every three minutes gap  during day time, i would like to have these timings seggregated as say 09 am to 11:00 am as  " 9 to 11 " , then 11:00 am to 1:00 pm as "11 to 1" so that when i create a visual it will look more standardised.  please guide me .

 

regards,

dsmitha 

1 ACCEPTED SOLUTION
tom480
Resolver I
Resolver I

Hi @Anonymous ,

 

Lots of ways to do this, here's one in DAX.

 

1)  Get the time out of the date/time column;

2)  Create your time bucket.  Could also be cleaned up with SWITCH but quick, easy way shown...

 

Time Bucket = IF ([Time2] < TIME(3,0,0), "0 - 3 AM", IF ([Time2] < TIME(6,0,0), "3 AM - 6 AM", IF ([Time2] < TIME(9,0,0), "6 AM - 9 AM",IF ([Time2] < TIME(12,0,0), "9 AM - 12 PM",IF ([Time2] < TIME(15,0,0), "12 PM - 3 PM","etc..")))))
 
If this is helpful, please mark as a solution to help others find solutions too!  Always glad to help!  Tom 
 
New column Time2New column Time2Create your buckets with IFsCreate your buckets with IFs

View solution in original post

2 REPLIES 2
tom480
Resolver I
Resolver I

Hi @Anonymous ,

 

Lots of ways to do this, here's one in DAX.

 

1)  Get the time out of the date/time column;

2)  Create your time bucket.  Could also be cleaned up with SWITCH but quick, easy way shown...

 

Time Bucket = IF ([Time2] < TIME(3,0,0), "0 - 3 AM", IF ([Time2] < TIME(6,0,0), "3 AM - 6 AM", IF ([Time2] < TIME(9,0,0), "6 AM - 9 AM",IF ([Time2] < TIME(12,0,0), "9 AM - 12 PM",IF ([Time2] < TIME(15,0,0), "12 PM - 3 PM","etc..")))))
 
If this is helpful, please mark as a solution to help others find solutions too!  Always glad to help!  Tom 
 
New column Time2New column Time2Create your buckets with IFsCreate your buckets with IFs
Anonymous
Not applicable

Hi tom480,

 

thanks a ton  for your quick and simple solution,  great !

 

regards,

dsmitha

 

Helpful resources

Announcements
Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

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.

Top Solution Authors