fbpx
[email protected] +1 203-349-9909 / +91-8080042523

How to Edit A Query Using Power Query

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.

BEFORE APPLYING CONDITIONAL COLUMN

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.

AFTER APPLYING CONDITIONAL COLUMN

BECOME A BUSINESS INTELLIGENCE ANALYST COURSE
• Power BI • Excel to Alteryx • SQL Programming Language • SAS Programming • Tableau • KNIME • many more

 

Step 3: Refresh Data after updating Data Table

Since this is employee data, it may keep changing. What if an employee has 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.

After Refreshing Data

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.

EDITING THE QUERY

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. DATA TABLE AFTER EDITING QUERY

You can learn more :