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

Next up in the FabCon + SQLCon recap series: The roadmap for Microsoft SQL and Maximizing Developer experiences in Fabric. All sessions are available on-demand after the live show. Register now

Reply
themoosegoose
Frequent Visitor

15 Minute Increments between 2 Timestamps

I have a table with start time and end time and I need to find all the 15 minute time increments between those two times. I have converted the start time and end time into a column that shows the closest time interval as shown below and the duration (how many 15 minute increments are in between).

 

TIME FLOOR TIME CEILING DURATION
7:30:00 AM 8:15:00 AM 3

 

I also have a table that has all the times in the day and each interval has it's own "sort" identifier.

time sort interval
7:00:00 AM 1 7:00:00 AM
7:01:00 AM 1 7:00:00 AM
7:02:00 AM 1 7:00:00 AM
7:03:00 AM 1 7:00:00 AM
7:04:00 AM 1 7:00:00 AM
7:05:00 AM 1 7:00:00 AM
7:06:00 AM 1 7:00:00 AM
7:07:00 AM 1 7:00:00 AM
7:08:00 AM 1 7:00:00 AM
7:09:00 AM 1 7:00:00 AM
7:10:00 AM 1 7:00:00 AM
7:11:00 AM 1 7:00:00 AM
7:12:00 AM 1 7:00:00 AM
7:13:00 AM 1 7:00:00 AM
7:14:00 AM 1 7:00:00 AM
7:15:00 AM 1 7:00:00 AM
7:16:00 AM 2 7:15:00 AM
7:17:00 AM 2 7:15:00 AM
7:18:00 AM 2 7:15:00 AM
7:19:00 AM 2 7:15:00 AM
7:20:00 AM 2 7:15:00 AM

 

I basically need something that looks like the below.

 

   0      1       1      1       1      0
7:15  7:30  7:45  8:00  8:15  8:30

 

1 ACCEPTED SOLUTION

Hi @themoosegoose,

 

Based on my test, you should be able to use the formula below to create a new measure, then show the new created measure as Values to get the expected result in your scenario. Smiley Happy

Measure 2 = SUMX(DATA,[Measure])

r1.PNG

 

Regards

View solution in original post

6 REPLIES 6
v-ljerr-msft
Microsoft Employee
Microsoft Employee

Hi @themoosegoose,

 

Based on my test, you should be able to use the formula below to create a measure.

Measure = 
CALCULATE (
    DISTINCTCOUNT(Table2[interval] ),
    FILTER (
        Table2,
        Table2[time] >= MAX ( Table1[TIME FLOOR] )
            && Table2[time] <= MAX ( Table1[TIME CEILING] )
    )
)+0

Then show the measure as Values, the interval column as Columns, and the index column from your first table as Rows on the Matrix visual to get the expected result in your scenario.

r2.PNG

 

Here is the sample pbix file for your reference. Smiley Happy

 

Regards

This worked when I had one case as an example, but not when there's many because it's only using the max value. I need the index to be a part of the measure because I have the date as the row

Capture_Time.PNG

 

Hi @themoosegoose,

 

Based on my test, you should be able to use the formula below to create a new measure, then show the new created measure as Values to get the expected result in your scenario. Smiley Happy

Measure 2 = SUMX(DATA,[Measure])

r1.PNG

 

Regards

We are back in business, thanks!!

Hi @themoosegoose,

 

Could you post your real table structures with some sample/mock, and the expected result? So that I can further assist on this issue. It's better to just share a sample pbix file which can reproduce the issue. You can upload it to OneDrive or Dropbox and post the link here. Do mask sensitive data before uploadingSmiley Happy

 

Regards

Helpful resources

Announcements
New to Fabric survey Carousel

New to Fabric Survey

If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.

Join our Fabric User Panel

Join our Fabric User Panel

Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.

March Power BI Update Carousel

Power BI Community Update - March 2026

Check out the March 2026 Power BI update to learn about new features.