Power Query also allows you to edit a query that you have already generated. Let’s take an example. Suppose you have a data table as shown below.
Editing A Query By Power Query
This is an employee data and you have to create the post for each employee based on their experience given in the data table.
Step 1: Select the ‘Experience’ column
To apply the conditions on your data table, you need to apply a conditional column. Select the ‘Experience’ column for applying conditions as shown in the picture below.
Step 2: Check your data after applying Conditional Column
After you apply the conditions, check the resulting data table once. Here, we have given the conditions as a junior, senior and rising senior as shown in below picture.
Step 3: Refresh Data after updating Data Table
Since this is an employee data, it may keep changing. What if an employee having zero experience joins the organization? In such a case, you have to first update the data table and then refresh it in Power Query. As shown below, it gives the wrong post for the newly added employee. To do this correction, we do not need to make the Post column from scratch. We can just edit the query and make only the required changes manually.
Step 4: Editing the Query
To edit the query, click on the Formula bar on the top of the data table.
Add the condition for value 0 as ‘Trainee’ as shown below and press enter.
This will give you the correct result as shown in the below picture. This is how you can edit the query in Power Query Editor.
You can learn more :
- Learn How to Split Queries In Power Query
- Navigate Query Editor in Excel
- Create Grouped Serial Numbers In Power Query
- Learn How to Manage Parameters in Excel