Power Query - How do I remove rows below a table with a similar dataset.

Wikimart

New Member
Joined
Dec 7, 2014
Messages
6
I just started using Power query so my knowledge is very basic.
The problem: When filter my data (data comes from MS Word and has tables in it) the results show data that similar to the rest of my output which makes me have to clean the data though a macro or though manual intervention It wouldn't be a problem if there were a few, but I'm getting hundreds of these data files a week - To add to the issue the data in each file is different.

+Making a macro in excel to do this adds to the complexity, so I'd like to avoid that route unless there is no other option.


After a clean my data as best I can, I get the following results for the example below. I want to delete any and all Rows (dynamically) after line 14 "BRU and Monthly Recurrent Cost" .

Help! :)
 

Attachments

  • PQ1.JPG
    PQ1.JPG
    152.8 KB · Views: 22

Excel Facts

Why are there 1,048,576 rows in Excel?
The Excel team increased the size of the grid in 2007. There are 2^20 rows and 2^14 columns for a total of 17 billion cells.
Power Query:
= Table.FirstN(Source, List.PositionOf(Source[Column1], "BRU and Monthly Recurrent Cost") +1)

Change Source[Column1] to the step name and column name for your query
 
Upvote 0
Solution
Thanks for the quick reply to my issue, I've run into some what I would call skill issue on my side, did I at least put the code in the right place(See image for result)
  • The Step name FRows
  • Code adjustments based on your comments (I think I fudged that up too )
    • = Table.FirstN(FRows, List.PositionOf(FRows[Column1], "BRU and Monthly Recurrent Cost") +1)
 
Last edited by a moderator:
Upvote 0
You've put two steps in one step. Delete the =Table.FirstN... stuff in the FRows step. Then with the FRows step selected click the fx button and put the =Table.FirstN... stuff there
 
Upvote 0
Power Query:
= Table.Range(Source, List.PositionOf(Source[Column1], "BRU and Monthly Recurrent Cost"))
 
Upvote 0

Forum statistics

Threads
1,223,641
Messages
6,173,506
Members
452,518
Latest member
SoerenB

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