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

The Power BI DataViz World Championships are on! With four chances to enter, you could win a spot in the LIVE Grand Finale in Las Vegas. Show off your skills.

Reply
Anonymous
Not applicable

generate time stamp between two time stamps?

Hello Everyone,

so I have these time stamps - 

Start TimeEnd Time

01/01/2022 10:00 AM 

                                                   

01/01/2022 10:30AM
 01/01/2022 11:30 AM01/01/2022 12:00PM

 

I want to generate the time stamp in between these two time stamps.

could you please guide me
It cannot be a measure. 

 

desired output : 

                                                   

Start TimeEnd Time  
01/01/2022 10:00 AM01/01/2022 10:30AM 
01/01/2022 10:30 AM01/01/2022 11:30AM 
01/01/2022 11:30 AM01/01/2022 12:00PM 



Thanks in advance 🙂 🙂 

1 ACCEPTED SOLUTION

Hi, @Anonymous 

My mistake, I just found out that I added the function "SAMPLE" to limit the result to 3 lines.(I added the sample function just to facilitate the sorting of Column ‘Start Time’)

Please modify my original formula as follows:

 

New Table = 
    UNION (
        SELECTCOLUMNS ( 'Table', "Start Time", 'Table'[Start Time] ),
        SELECTCOLUMNS ( 'Table', "Start Time", 'Table'[End Time] )
    )

 

12.png

Hope this could work for you.

 

Best Regards,
Community Support Team _ Eason

View solution in original post

7 REPLIES 7
Anonymous
Not applicable

I am trying to create a simulation in power BI.

Hi, @Anonymous 

Try formuals as below:
Add a new calculated Table:

New Table = 
SAMPLE (
    3,
    UNION (
        SELECTCOLUMNS ( 'Table', "Start Time", 'Table'[Start Time] ),
        SELECTCOLUMNS ( 'Table', "Start Time", 'Table'[End Time] )
    ),
    [Start Time], ASC
)

Add a new calculated column:

End Time =
CALCULATE (
    MIN ( 'New Table'[Start Time] ),
    FILTER (
        'New Table',
        'New Table'[Start Time] > EARLIER ( 'New Table'[Start Time] )
    )
)

6.png

Please check my sample file for more details.

 

Best Regards,
Community Support Team _ Eason

Anonymous
Not applicable

You are close to the solution however, we are missing the first time duration ie. 1/1/2022 10:00 AM  - 1/1/2022 10:30 AM. and also the next time row 1/1/2022 10:30 AM - 1/1/20222 11:30 AM

Hi, @Anonymous 

My mistake, I just found out that I added the function "SAMPLE" to limit the result to 3 lines.(I added the sample function just to facilitate the sorting of Column ‘Start Time’)

Please modify my original formula as follows:

 

New Table = 
    UNION (
        SELECTCOLUMNS ( 'Table', "Start Time", 'Table'[Start Time] ),
        SELECTCOLUMNS ( 'Table', "Start Time", 'Table'[End Time] )
    )

 

12.png

Hope this could work for you.

 

Best Regards,
Community Support Team _ Eason

Anonymous
Not applicable

You are awesome 🙂 🙂 

vojtechsima
Super User
Super User

Hi, @Anonymous 
I am not sure what you're trying to accomplish,
You want duration between two datetimes or you have let's say 1/1/2022 10:00 AM and then you have 1/1/2022 12:30 and you want to generate timestamp in between, each after let's say 30 minutes?
So the outcome would be:
1/1/2022 10:30 AM
1/1/2022 11:00 AM
1/1/2022 11:30 AM

Anonymous
Not applicable

I have update the post.
Hopefully it helps.

 

Thank you!

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

FebPBI_Carousel

Power BI Monthly Update - February 2025

Check out the February 2025 Power BI update to learn about new features.

Feb2025 NL Carousel

Fabric Community Update - February 2025

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