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

Earn the coveted Fabric Analytics Engineer certification. 100% off your exam for a limited time only!

Reply
Anonymous
Not applicable

Round Date/Time field to nearest 30 minutes

I have a date/time field that I need to round to the nearset 30 minute interval. For example, 6/8/18 1:33 PM would round to 6/8/18 1:30 PM and 6/8/18 1:46 PM would round to 6/8/18 2:00 PM. I'd like to do this in the query editor if possible, but would settle for DAX if needed.

1 ACCEPTED SOLUTION

Hi @Anonymous,

 

Then try this :

 

if Time.Minute([Original Column])/15>3 then [Original Column]+#duration(0,0,60-Time.Minute([Original Column]),-Time.Second([Original Column])) else if Time.Minute([Original Column])/15<1 then [Original Column]+#duration(0,0,-Time.Minute([Original Column]),-Time.Second([Original Column])) else [Original Column]+#duration(0,0,30-Time.Minute([Original Column]),-Time.Second([Original Column])))

Ninter

View solution in original post

11 REPLIES 11

Helpful resources

Announcements
April AMA free

Microsoft Fabric AMA Livestream

Join us Tuesday, April 09, 9:00 – 10:00 AM PST for a live, expert-led Q&A session on all things Microsoft Fabric!

March Fabric Community Update

Fabric Community Update - March 2024

Find out what's new and trending in the Fabric Community.