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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

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
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

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

April Fabric Community Update

Fabric Community Update - April 2024

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