Filling Empty Cells in Gross Annual Salary Column

INN

Board Regular
Joined
Feb 3, 2021
Messages
128
Office Version
  1. 365
Platform
  1. Windows
Hi,

I have a table with three columns: Country, Annual Salary, and Gross Annual Salary. Some cells under the Gross Annual Salary column are empty. How can I fill these cells with the same values as those in the Annual Salary column? using power Q. Thank you.
 

Excel Facts

Did you know Excel offers Filter by Selection?
Add the AutoFilter icon to the Quick Access Toolbar. Select a cell containing Apple, click AutoFilter, and you will get all rows with Apple
Simple way is to add a new calculated column using something like:

Power Query:
=if [Gross Annual Salary] = null then [Annual Salary] else [Gross Annual Salary]

then remove the original Gross Annual Salary column.
 
  • Like
Reactions: INN
Upvote 0
Simple way is to add a new calculated column using something like:

Power Query:
=if [Gross Annual Salary] = null then [Annual Salary] else [Gross Annual Salary]

then remove the original Gross Annual Salary column.
I'd update to
Power Query:
=if [Gross Annual Salary] = null or [Gross Annual Salary] = "" then [Annual Salary] else [Gross Annual Salary]
in case it isn't truly null.
 
  • Like
Reactions: INN
Upvote 0
Thank you all, can that be done without writing M language code? Thank you again.
 
Upvote 0
Not really, why? Anything you do in PQ is using M code.
 
  • Like
Reactions: INN
Upvote 0
I mean...a Find and Replace in your data prior to refreshing your queries, but that is too manual for my taste.
 
Upvote 0

Forum statistics

Threads
1,224,824
Messages
6,181,187
Members
453,020
Latest member
Mohamed Magdi Tawfiq Emam

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top