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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
reportuser
Helper II
Helper II

Creating 15 Minute intervals from Date and Time Column

Date&Time.PNG

1. I have a column named,"STATS_DATE" which contains dates and time
2. Made a new column named, "Date" which contains only date from STATS_DATE
3. Made a new column named, "Time" which contains only time from STATS_DATE
4. Made a new column named, "Minutes" 

Minutes = DATEDIFF(DATE(1899,12,30),Table[Time],MINUTE)

5. Made a new column named, "15Min_Data"

15Min_Data = INT(DATEDIFF(DATE(1899,12,30),Table[Time],MINUTE) / 15)

How do I convert it into intervals @amitchandak ?

1 ACCEPTED SOLUTION

Try formatting this as Time data type:

15Min_Data = ROUNDDOWN ( 'Table'[Time] * 24 * 60 / 15, 0 ) / ( 24 * 60 / 15 )

 

You can just use 96 instead of 24 * 60 / 15 since there are 96 fifteen-minute intervals in one day.

View solution in original post

9 REPLIES 9
AlexisOlson
Super User
Super User

What is the end result that you want? What should the column look like?

The end result could be the start of the 15 minute interval like so

12:00 AM
12:15 AM
12:30 AM

Try formatting this as Time data type:

15Min_Data = ROUNDDOWN ( 'Table'[Time] * 24 * 60 / 15, 0 ) / ( 24 * 60 / 15 )

 

You can just use 96 instead of 24 * 60 / 15 since there are 96 fifteen-minute intervals in one day.

How do I display the intervals?

Interval.PNG



I'd suggest trying what I posted. Those big integers you have don't look very useful to me.

The column named,  "15Min_Data" uses the formula you posted above. 

Hmm. Then I suspect your Time column is not a time data type. If you convert that column to a decimal number, it should show values between 0 and 1 not big integers like that.

@reportuser, from what I can see, @AlexisOlson has provided the right solution.  He mentioned that the values for a column that does not have the Data Type set to Time will be between 0 and 1 like that in the 15Min_Data (Non-Time Data Type) column.  Yours appear to be >1. Have you set the Time column to Data Type = Time?  If not, this might be the issue. Alternatively, you may have not copied his Calculated Column formula correctly?  Either way, hope it works out as the solution provided by @AlexisOlson is really sweet! (Cheers @AlexisOlson!!).

 

TheoC_2-1633669655100.png

 

If I have posted a response that resolves your question, please accept it as a solution to formally close the post.

Also, if you are as passionate about Power BI, DAX and data as I am, please feel free to reach out if you have any questions, queries, or if you simply want to connect and talk to another data geek!

Want to connect?www.linkedin.com/in/theoconias

@TheoC , the screenshot helped. @AlexisOlson  - thank you so much for providing the solution 🙂

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

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