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

Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started

Reply
Anonymous
Not applicable

How do i add additional rows in M QUERY

I want to add more rows using the Query editor (Power query/ M Query) in only the Start Date and End Date column:

 

+----------+------------------+--------------+-----------+-------------+------------+
| Employee |  Booking Type    |     Jobs     | WorkLoad% | Start Date  |  End date  |
+----------+------------------+--------------+-----------+-------------+------------+
| John     | Chargeable       | CNS          |        20 | 04/02/2020  | 31/03/2020 |
| John     | Chargeable       | CNS          |        20 | 04/03/2020  | 27/04/2020 |
| Bernard  | Vacation/Holiday | SN           |       100 | 30/04/2020  | 11/05/2020 |
| Bernard  | Vacation/Holiday | Annual leave |       100 | 23/01/2020  | 24/02/2020 |
| Bernard  | Chargeable       | Tech PLC     |        50 | 29/02/2020  | 30/03/2020 |
+----------+------------------+--------------+-----------+-------------+------------+

 

I want to find the MIN(Start Date) and MAX(End Date) and then append the range of start to end dates to this table only in the Start Date and End Date column in the Query Editor (Power Query/ M Query). Preferrable if I can create another table2 duplicating the original table and append these rows. For example: This is the table i want form the above table:

 

+----------+------------------+--------------+-----------+-------------+------------+
| Employee |  Booking Type    |     Jobs     | WorkLoad% | Start Date  |  End date  |
+----------+------------------+--------------+-----------+-------------+------------+
| John     | Chargeable       | CNS          |        20 | 04/02/2020  | 31/03/2020 |
| John     | Chargeable       | CNS          |        20 | 04/03/2020  | 27/04/2020 |
| Bernard  | Vacation/Holiday | SN           |       100 | 30/04/2020  | 11/05/2020 |
| Bernard  | Vacation/Holiday | Annual leave |       100 | 23/01/2020  | 24/02/2020 |
| Bernard  | Chargeable       | Tech PLC     |        50 | 29/02/2020  | 30/03/2020 |
|          |                  |              |           | 23/01/2020  | 23/01/2020 |
|          |                  |              |           | 24/01/2020  | 24/01/2020 |
|          |                  |              |           | 25/01/2020  | 25/01/2020 |
|          |                  |              |           | 26/01/2020  | 26/01/2020 |
|          |                  |              |           | 27/01/2020  | 27/01/2020 |
|          |                  |              |           | 28/01/2020  | 28/01/2020 |
|          |                  |              |           | 29/01/2020  | 29/01/2020 |
|          |                  |              |           | 30/01/2020  | 30/01/2020 |
|          |                  |              |           | 31/01/2020  | 31/01/2020 |
|          |                  |              |           | ...         | ...        |
|          |                  |              |           | 11/05/2020  | 11/05/2020 |
+----------+------------------+--------------+-----------+-------------+------------+
1 ACCEPTED SOLUTION
v-frfei-msft
Community Support
Community Support

Hi @Anonymous ,

 

Please try  To insert rows in table.

Or you can append queries to work around.

 

 

Community Support Team _ Frank
If this post helps, then please consider Accept it as the solution to help the others find it more quickly.

View solution in original post

2 REPLIES 2
v-frfei-msft
Community Support
Community Support

Hi @Anonymous ,

 

Please try  To insert rows in table.

Or you can append queries to work around.

 

 

Community Support Team _ Frank
If this post helps, then please consider Accept it as the solution to help the others find it more quickly.

Helpful resources

Announcements
Europe Fabric Conference

Europe’s largest Microsoft Fabric Community Conference

Join the community in Stockholm for expert Microsoft Fabric learning including a very exciting keynote from Arun Ulag, Corporate Vice President, Azure Data.

AugPowerBI_Carousel

Power BI Monthly Update - August 2024

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

August Carousel

Fabric Community Update - August 2024

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