Assistance Needed with Removing Extra Rows and Deleting Spaces in Power Query

itsgrady

Board Regular
Joined
Sep 11, 2022
Messages
132
Office Version
  1. 2021
Platform
  1. Windows
  2. MacOS
I am seeking your help regarding a challenge I am facing with Power Query.

I regularly import a file into Power Query as an Excel Table. Unfortunately, this file always contains two extra rows at the bottom that I need to remove. I would like to automate this process using Power Query, but I am unsure of the specific steps to take. Could you kindly guide me on how to remove these extra rows through Power Query?

Furthermore, within the Excel file, there is a column with data. However, all the empty cells in this column contain two spaces. I would like to delete these spaces in the empty cells using Power Query. I currently perform a manual process after running the Query. I believe there must be an efficient way to achieve this using Power Query.

I would greatly appreciate it if you could assist me with these challenges. Any guidance or instructions you can provide would be immensely helpful.

Thank you very much for your time and help.
 

Excel Facts

How to total the visible cells?
From the first blank cell below a filtered data set, press Alt+=. Instead of SUM, you will get SUBTOTAL(9,)
To remove the bottom 2 rows.
Power Query:
= Table.RemoveLastN(#"Previous Step",2)

To remove the empty spaces and replace them with nulls.

Power Query:
= Table.ReplaceValue(#"Previous Step,"  ",null,Replacer.ReplaceValue,{"Column Name"})
 
Upvote 1
Solution
To remove the bottom 2 rows.
Power Query:
= Table.RemoveLastN(#"Previous Step",2)

To remove the empty spaces and replace them with nulls.

Power Query:
= Table.ReplaceValue(#"Previous Step,"  ",null,Replacer.ReplaceValue,{"Column Name"})

Thanks for taking time to point me in a good direction on this Query problem. I like using Query, but I’m still learning my way through it. I appreciate the help!
 
Upvote 0

Forum statistics

Threads
1,223,908
Messages
6,175,306
Members
452,633
Latest member
DougMo

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