How To Add Rows In Power Bi Query Editor

How to Add Rows in Power BI Query Editor

The Query Editor in Power BI allows you to transform and shape data before loading it into your Power BI model. Adding rows in the Query Editor can be done using various techniques and functions.

1. Insert Row

To insert a row in the Query Editor, follow these steps:

  1. Select the desired table or query in the “Queries” pane.
  2. On the “Home” tab, click on the “Edit Queries” button.
  3. In the Query Editor window, go to the “Home” tab again and click on the “Insert Rows” button.
  4. A new row will be inserted at the end of the table.
  5. You can then fill in the values for each column in the new row.

2. Append Queries

If you have multiple tables or queries that you want to combine and add rows to, you can use the “Append Queries” function:

  1. Select the first table or query in the “Queries” pane.
  2. On the “Home” tab, click on the “Edit Queries” button.
  3. In the Query Editor window, go to the “Home” tab again and click on the “Append Queries” button.
  4. Select the tables or queries you want to append.
  5. Click on the “OK” button to combine the tables or queries and add their rows together.

3. Merge Queries

If you want to add rows based on a condition or matching key column, you can use the “Merge Queries” function:

  1. Select the first table or query in the “Queries” pane.
  2. On the “Home” tab, click on the “Edit Queries” button.
  3. In the Query Editor window, go to the “Home” tab again and click on the “Merge Queries” button.
  4. Select the second table or query you want to merge with.
  5. Select the matching key columns between the two tables.
  6. Click on the “OK” button to merge the queries and add matching rows.

Example

Let’s say you have two tables: “Customers” and “Orders”. To add rows from the “Orders” table to the “Customers” table, you can use the “Merge Queries” function:

  1. Select the “Customers” table in the “Queries” pane.
  2. On the “Home” tab, click on the “Edit Queries” button.
  3. In the Query Editor window, go to the “Home” tab again and click on the “Merge Queries” button.
  4. Select the “Orders” table.
  5. Select the matching key columns, such as “Customer ID”.
  6. Click on the “OK” button to merge the queries and add the matching rows from the “Orders” table to the “Customers” table.

Leave a comment