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
RandomDenny
Frequent Visitor

Calculating count of events in 15 minute datetime intervals

I have a table of VPN session start and end times and I need to plot active sessions across time in 15 minute increments.

 

Sessions.png

 

So for each 15 minute block (12:00, 12:15, 12:45 etc) I need the count of sessions opened that day before that block, minus the count of sessions ended that day before that block.

 

I started down the path of trying to create a datetime calendar with the 15 minute blocks first, but I'm a newbie to this so I thought I might post and see if there's a simpler way. 

 

Thanks

2 REPLIES 2
amitchandak
Super User
Super User

@RandomDenny , refer if this can fill

https://kohera.be/blog/power-bi/how-to-create-a-time-table-in-power-bi-in-a-few-simple-steps/

 

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

That is actually the path I started down,

 

I created a Date Table:

Date = CALENDAR(DATE(2020,1,1),TODAY())

 

And I created a TimeTable

 

TimeTable =

VAR HourTable = SELECTCOLUMNS(GENERATESERIES((0), (23)), "Hour", [Value])

VAR MinuteTable = SELECTCOLUMNS(GENERATESERIES((0), (59), 15), "Minute", [Value])

 

RETURN

ADDCOLUMNS(

CROSSJOIN(HourTable, MinuteTable),

"Time", TIME([Hour], [Minute], 0)

)

 

The "Time" column gives me a Datetime value that is in the 15 minute blocks like I want, but it's generating dates that are in 1899. ?! I need this column to have the date values from the Date table, but with the time part of the value in the 15 minute blocks as they are now.

 

So instead of

timetable.png

I need the Time column to look like

01/01/2020 12:00:00 AM

01/01/2020 12:15:00 AM

01/01/2020 12:30:00 AM

01/01/2020 12:45:00 AM

Etc.

 

Then there is still the matter of the calculations, which I think might be straightforward enough if I can get this table in the format that I want. But that was where I decided to post and make sure I wasn't missing a simpler way.

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