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

Level up your Power BI skills this month - build one visual each week and tell better stories with data! Get started

Reply
Anonymous
Not applicable

Add missing rows with missing date and time in Power Query

Hello everyone,

 

I need your help please, I have a table with several IDs and for each ID, I have several dates and timestamp and values, normally, I should have for each ID -rows for each hour, but I miss some hours.

 

So, for those missing hours I need to add in Power Query the missing rows and the values to be taken from last time we had a timestamp.

For example: if I have a row for 6/1/2024  1:00 AM and the next row is 6/2/2024 3:00 PM, I need to add the missing rows for each hour between this interval and the values to be taken from 6/1/2024.

 

GiaVoi10_0-1717756108244.png

 

Many thanks.

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi  @Anonymous ,

Here are the steps you can follow:

1. Create a datetable.

vyangliumsft_0-1717987092602.png

2. Copy -- Table.

vyangliumsft_1-1717987092603.png

Select [Date] and [Value] – Remove Columns.

vyangliumsft_2-1717987111475.png

Select [ID] – Remove Rows – Remove Duplicates.

vyangliumsft_3-1717987111478.png

vyangliumsft_4-1717987124876.png

3. Add Column – Custom Column – Enter Date table name “Date”.

vyangliumsft_5-1717987139399.png

vyangliumsft_6-1717987139400.png

4. Home – Merge Queries -- Merge Queries.

vyangliumsft_7-1717987175245.png

vyangliumsft_8-1717987175247.png

5. Select [Table] – [Value].

vyangliumsft_9-1717987192676.png

Select [Table.Value] – Fill Down

vyangliumsft_10-1717987192678.png

6. Result:

vyangliumsft_11-1717987208416.png

 

Best Regards,

Liu Yang

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly

View solution in original post

1 REPLY 1
Anonymous
Not applicable

Hi  @Anonymous ,

Here are the steps you can follow:

1. Create a datetable.

vyangliumsft_0-1717987092602.png

2. Copy -- Table.

vyangliumsft_1-1717987092603.png

Select [Date] and [Value] – Remove Columns.

vyangliumsft_2-1717987111475.png

Select [ID] – Remove Rows – Remove Duplicates.

vyangliumsft_3-1717987111478.png

vyangliumsft_4-1717987124876.png

3. Add Column – Custom Column – Enter Date table name “Date”.

vyangliumsft_5-1717987139399.png

vyangliumsft_6-1717987139400.png

4. Home – Merge Queries -- Merge Queries.

vyangliumsft_7-1717987175245.png

vyangliumsft_8-1717987175247.png

5. Select [Table] – [Value].

vyangliumsft_9-1717987192676.png

Select [Table.Value] – Fill Down

vyangliumsft_10-1717987192678.png

6. Result:

vyangliumsft_11-1717987208416.png

 

Best Regards,

Liu Yang

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly

Helpful resources

Announcements
April Power BI Update Carousel

Power BI Monthly Update - April 2026

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

Fabric SQL PBI Data Days

Data Days 2026 coming soon!

Sign up to receive a private message when registration opens and key events begin.

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.