Removing data while in power query

Vegas01

New Member
Joined
Jun 15, 2021
Messages
43
Office Version
  1. 2019
Platform
  1. Windows
Hi

This is probably a really simple question but have not been able to work it out.

In the last column I would like to delete all of the data that does not start with "L" so they become a null so I have fill down with the L data.

Previously I have been taking the spreadsheet back to excel deleting the data, then bring back to Power query to do the Fill Down function. I would like to try and do it all in the one place.

It is doable?

1625200663713.png
 

Excel Facts

Create a Pivot Table on a Map
If your data has zip codes, postal codes, or city names, select the data and use Insert, 3D Map. (Found to right of chart icons).
Click on Add Column-->Custom Column
type
Power Query:
=Text.StartsWith([Vendor No],"L") then [Vendor No] else null
Change the name of the new column from Custom to Vendor Nr
Highlight column Vendor No and right click and select Remove.
 
Upvote 0
Alansidman

Thanks for that but it is giving me an error on the "Then"

I understand what needs to be done but not sure why the error. Thanks in advance.



1625210223428.png
 
Upvote 0
My bad, I forgot to place an if in front of the statement.. It should read

if Text.StartsWith(Vendor No), "L") then [Vendor No] else null
 
Upvote 0
Solution
Alansidman

Thanks for that I got it to work.

But now it was given me the error in the cells, which will not allow the Fill down of the vendor number to work.

So some how have to remove the errors and replace them with null



1625442647690.png
 
Upvote 0
Alansidman

Thanks for all of your help, I solve the error issue myself. I will learn ow this works.
 
Upvote 0

Forum statistics

Threads
1,223,706
Messages
6,173,998
Members
452,542
Latest member
Bricklin

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