Automatically Remove Top Junk Rows & Combine Data from Multiple Excel Files

แชร์
ฝัง
  • เผยแพร่เมื่อ 8 ต.ค. 2024
  • Check out our newly launched M Language course ↗️ - goodly.co.in/l...
    In this video, we will learn to remove junk rows from the top and combine data from multiple Excel files. We will explore three Excel files, each containing a few unwanted rows at the top. Our goal is to remove this inconsistent number of junk rows and merge the data from all the files automatically.
    ===== ONLINE COURSES =====
    ✔️ Mastering DAX in Power BI -
    goodly.co.in/l...
    ✔️ Power Query Course-
    goodly.co.in/l...
    ✔️ Master Excel Step by Step-
    goodly.co.in/l...
    ✔️ Business Intelligence Dashboards-
    goodly.co.in/l...
    ===== LINKS 🔗 =====
    Blog 📰 - www.goodly.co....
    Corporate Training 👨‍🏫 - www.goodly.co....
    Need my help on a Project 💻- www.goodly.co....
    Download File ⬇️ - goodly.co.in/a...
    ===== CONTACT 🌐 =====
    Twitter - / chandeep2786
    LinkedIn - / chandeepchhabra
    Email - goodly.wordpress@gmail.com
    ===== WHO AM I? =====
    A lot of people think that my name is Goodly, it's NOT ;)
    My name is Chandeep. Goodly is my full-time venture where I share what I learn about Excel and Power BI.
    Please browse around, you'd find a ton of interesting videos that I have created :) Cheers!

ความคิดเห็น • 135

  • @sharadpunita
    @sharadpunita 22 วันที่ผ่านมา +2

    I am 70 having no use of learning Excel/Power query! I keep watching your videos as I like the way you solve problems. I have learnt so much from your teaching. Can I pay some Token for whatever I have learnt.

  • @nelson_k_d
    @nelson_k_d 4 หลายเดือนก่อน +4

    I saved the entire syntax as follows:
    Add Custome Column =Table.PromoteHeaders(Table.Skip([Data], each not List.ContainsAny( Record.ToList(_), {"Header1", "Header2"} )))
    Works wonders!!
    Thanks a ton bro!!

  • @nitish9111
    @nitish9111 วันที่ผ่านมา

    Thanks Chandeep! I was using Index for this one, but you make it so easy. Learning from your videos is amazing! Keep up the good work!

  • @OmisileKehindeOlugbenga
    @OmisileKehindeOlugbenga ปีที่แล้ว +5

    Pretty awesome! Thanks a lot for this. Record, Table and List object manipulation in one video for one task without using "Remove Other Columns"

  • @josepepe741
    @josepepe741 3 หลายเดือนก่อน

    It is a huge pleasure to look at your videos. Moving from excel advanced user to Power query person. Thanks a lot.

  • @ramonillarramendi3191
    @ramonillarramendi3191 11 หลายเดือนก่อน

    Wow..Amazing. Been struggling with removing dynamically the junk and with custom headers for a while now. This works like a charm. Thanks a mill.

  • @retamapark
    @retamapark 9 หลายเดือนก่อน

    Thanks, Chandeep! I knew you had posted this, and I had this problem today. I was fooling around with different other approaches that were a mess. This was perfect!

  • @goodnewskasparyaodzramedo9097
    @goodnewskasparyaodzramedo9097 ปีที่แล้ว

    This is wonderful @Goodly. I watch all your videos. From the logic to the solution of the problem and the actual solution. God continually bless you, you are a messiah!

  • @JeevanC-l3k
    @JeevanC-l3k 8 หลายเดือนก่อน

    I am actually learning power query its Excellent. I like the way to teach. Thank u so, Much for this video.

  • @Phippsy23
    @Phippsy23 ปีที่แล้ว +1

    Amazing, I've done this with a fixed Skip value but this is on another level! Thanks

  • @odallamico
    @odallamico 4 หลายเดือนก่อน

    Dear, you are a genius. You make M language look so easy. I appreciate your videos, my respects to you.

  • @Sarvabhauma
    @Sarvabhauma 3 หลายเดือนก่อน

    Thanks @Chandeep, I got it based on your trick im able to do it for removal of top rows. I also wanted to do for bottom rows, there is lot of junk bottom rows from my sheet, i applied same trick but i have added index row with descending order then applied this trick for to remove junk rows from sheet and sort ascending order index back.. Anyways your tricks are fantastic.

  • @justinwduff
    @justinwduff ปีที่แล้ว

    Thank you, SO MUCH! Had about 200 files to combine with various junk rows up top and now I can do it :D

    • @GoodlyChandeep
      @GoodlyChandeep  ปีที่แล้ว

      Woah.. thats a lot of files.
      I am glad I could help

  • @aahanavikram07
    @aahanavikram07 ปีที่แล้ว +2

    You hear the problem it seems😂
    I was using filter method and removing null values and a lot of other filter method.
    Thanks for making the work easier and cleaner ❤

  • @Chillman666
    @Chillman666 ปีที่แล้ว

    You have no idea how much Power Query has helped me to automate my tasks. Also I have been struggling with this problem. A big THANK YOU ❤!

  • @tARasKoni
    @tARasKoni ปีที่แล้ว

    M-Masterpiece!
    Packing a lot of slick tricks in one video.
    Thank you Chandeep!

  • @joukenienhuis6888
    @joukenienhuis6888 ปีที่แล้ว

    Thanks again for such a great clear videobabout the next step in PowerQuery. I am new in PowerQuery, but i am experimenting on DAX and you are giving a great explanation

  • @vl21i
    @vl21i ปีที่แล้ว

    Super Awesome, Chandeep.
    Very powerful formulas that you are teaching in a simple and easy understandable way !
    Power Query and DAX are having lot of hidden treasures

  • @rhaps2008
    @rhaps2008 ปีที่แล้ว

    Amazing, I have had to struggle through with this exact issue to manually remove those junk rows, your a life saver I will be using this in the future

  • @inaction2024
    @inaction2024 11 หลายเดือนก่อน

    This is a lifesaving technique. Thank you for sharing with us.

  • @decentmendreams
    @decentmendreams ปีที่แล้ว

    Your methods become so refined over time . Awesome job

  • @Adam_K_W
    @Adam_K_W 5 หลายเดือนก่อน

    This is great! What is the best way to do this when your source files are not formatted as Tables, but are simply Excel Worksheets?

  • @roywilson9580
    @roywilson9580 ปีที่แล้ว +1

    Thanks for the video. Much better than only skipping rows to one hardcoded value, makes sense to use if your column order is not the same across data tables.

  • @rajanpradeepankarath8846
    @rajanpradeepankarath8846 ปีที่แล้ว

    yeah that is pretty damn awesome, Chandeep. this is an everyday challenge

  • @ursvenky6394
    @ursvenky6394 ปีที่แล้ว

    Awesome video. I was struggling earlier. I had work by using macro. This is very cool. Thanks Goodly

  • @setantadundalk
    @setantadundalk ปีที่แล้ว

    Very sleek. I had this very same issue but I used List.Generate to loop through each record which suppose would take slightly more processing time but nothing you would ever notice.

  • @rohitwaradpande2492
    @rohitwaradpande2492 ปีที่แล้ว

    This was awesome video. Thanks for the same. I liked the trick that you used to removed the blanks dynamically.

  • @manojsakthi6201
    @manojsakthi6201 ปีที่แล้ว

    its very awesome, i hade a similar issue had to work around it, but this looks pretty good

  • @bohdanduda652
    @bohdanduda652 ปีที่แล้ว +4

    Another way, how we can do it, it is add additional column using List.PositionOf and due to that calculate in which position we have Date and Profit

  • @pmsocho
    @pmsocho 7 หลายเดือนก่อน

    Awesome. Great logic. Thanks for the video.

  • @MikeMcGlynn
    @MikeMcGlynn 3 หลายเดือนก่อน +2

    Hello, trying to see if any one else ran into this issue:
    -Followed all steps and worked as they should until ~7:00 when we're supposed to transform the content from Binary to a Table. My files are all CSV so the formula I ended up using was =Table.TransformColumns(Source,{"Content",Csv.Document}) instead of =Table.TransformColumns(Source,{"Content",Excel.Workbook}) that is used in the video. It converted to Tables fine.
    -Then on the next step (7:40) where you're supposed to expand the tables and see all of the sheets, when I do this...the header options are just Column 1, Column 2, etc. instead of the actual headers...AND every row of all the files shows up instead of just the sheet name.
    -When I follow the steps afterwards, I get the error: "dataformat.error there were more columns in the result than expected"
    Any idea what's going on?

  • @wensesvincen4877
    @wensesvincen4877 ปีที่แล้ว

    Hi Goodly, Wonderful and Powerful Trick...Keep up the good work. What if you are importing from PDF files...Trying to convert the binary gives a different results.

  • @stephenandrews1291
    @stephenandrews1291 10 หลายเดือนก่อน

    this is awesome; thank you! one question - i need to add a column into the combined file that shows the original source filename for each record... where in the flow and how best to do that please?

  • @syrophenikan
    @syrophenikan ปีที่แล้ว +1

    Fantastic! This is definitely going into my daily routine.

  • @rahulmahajan5932
    @rahulmahajan5932 ปีที่แล้ว

    Awe Stucked... No Words to Express How Fantabulous It is

  • @FarkadBarri
    @FarkadBarri 2 หลายเดือนก่อน

    This is awesome! I have one challenge, that one of the first rows contain the date of report and I want it to be within the data columns , how to do that :D!

  • @cesarsaldana3429
    @cesarsaldana3429 2 หลายเดือนก่อน

    Amazing!!!, Greetings from Mexico.

  • @ShubhamSharma-ls6hj
    @ShubhamSharma-ls6hj ปีที่แล้ว

    Very well explained thanku so much brother.

  • @Rice0987
    @Rice0987 ปีที่แล้ว

    Magosh... It's just simple brilliant!💎
    Thanks a bunch for yor priceless help!🤗👦

  • @santiagovillamoreno6821
    @santiagovillamoreno6821 ปีที่แล้ว

    Beautiful Power Query techniques!!

  • @swathimanda5342
    @swathimanda5342 ปีที่แล้ว

    Hi Goodly,
    That was an amazing video. I learned a lot from your videos for my daily tasks with excel. It saves lot of my time. God bless you.
    I have a question please if you can answer that, when I covert pdf to excel most of the column values are not aligned into 1 column but locate on either side.
    Ex: column B dates, should be in column B but on few rows it will be on A or C.
    How can I align them into just 1 column B.
    Please advise.
    Thank you for all your great videos. 🙏

  • @zahir585
    @zahir585 ปีที่แล้ว

    Genius 🔥 thank you my friend sooo helpful ❤️❤️❤️

  • @excel-in-g
    @excel-in-g ปีที่แล้ว

    As always, very neat & clear stuff. 👍
    I was wondering if one can't use Table.FindText?
    Like, each Table.Skip( _,Table.PositionOf(_, Table.FindText(_, "Profit"){0} )))
    But only testing for 1 column header here.

  • @iankr
    @iankr ปีที่แล้ว

    Brilliant! Many thanks, Mr Goodly.

  • @cherianiype
    @cherianiype ปีที่แล้ว

    ooff!! SHABASH! Terrific video Chandeep! Superb!! Sixer Maar diya!

  • @jianlinchen7978
    @jianlinchen7978 5 หลายเดือนก่อน

    really very helpful. Thanks . It is a good idea

  • @noorbisharmohamed
    @noorbisharmohamed ปีที่แล้ว

    Fantastic! But can we use "is blank" instead of "not Contain any" as the condition?
    Or promote headers if record contains any " Date", "Amount" etc?

  • @davidjosevarelagarcia7011
    @davidjosevarelagarcia7011 ปีที่แล้ว

    Great , excellent. Simple like that. Thanks.

  • @SAIKISH2005
    @SAIKISH2005 2 หลายเดือนก่อน

    Marvelous work ji

  • @eslamfahmy87
    @eslamfahmy87 ปีที่แล้ว

    Actually, I think you are the only youtuber instructor who is preparing depth & creative PQ examples.
    Really, fantastic 👏, elegance & more simple 😊

  • @chrism9037
    @chrism9037 ปีที่แล้ว

    Fantastic Chandeep, thank you!

  • @SandhyaSingh-qk6up
    @SandhyaSingh-qk6up ปีที่แล้ว +1

    Can this also be solved by using index number and custom function?

  • @emilmubarakshin49
    @emilmubarakshin49 ปีที่แล้ว

    Fantastic video and amazing explanation!

  • @BharathiM-t8y
    @BharathiM-t8y 8 หลายเดือนก่อน

    admiring the brilliance

  • @andreass.3130
    @andreass.3130 ปีที่แล้ว +1

    Hi Goodly, thanks for all your great videos. Isn't there a simpler way to do it here? In the example file you create a conditional column (If Column1=Date Then True). Then you fill the conditional column downwards. Now you have a True for all rows you need and a null value above the desired header row. So you can filter for True. Shouldn't that be dynamic as well?

    • @DAXifiedSatish
      @DAXifiedSatish ปีที่แล้ว

      No. In that way if u filter true it will be with junk rows and all data except headers and if u filter for false u will get only headers

  • @mohitchaturvedi8931
    @mohitchaturvedi8931 ปีที่แล้ว

    Delighted, this is the problem of every hour.
    Many times data come with merged header, which you have sorted already,

  • @cooolbreeze
    @cooolbreeze ปีที่แล้ว

    Pretty cool. Seems the only thing that would limit what one can do with PQ is one's imagination. Question, why List.ContainsAny instead of List.ContainsAll?

  • @patrickharilantoraherinjat2994
    @patrickharilantoraherinjat2994 ปีที่แล้ว

    Great video Goodly ! what if I have a junk rows and also a junk columns. is it possible to combine? Thanks

    • @GoodlyChandeep
      @GoodlyChandeep  ปีที่แล้ว

      Thanks Patrick.
      May this video will help th-cam.com/video/1fn8fXYw6M4/w-d-xo.html

  • @rogeriopsvalle
    @rogeriopsvalle ปีที่แล้ว

    Hi Goodly.
    Thanks for all videos. They are just great.
    I need to combine two of your tricks in just one.
    I have many sheets with junk lines (same number of junk lines for all sheets) and these same sheets have inconsistent columns.
    How do I do that?
    Thanks in advance

    • @GoodlyChandeep
      @GoodlyChandeep  ปีที่แล้ว

      You code to remove the junk headers can probably be
      Table.Skip ( Table, List.MatchesAny(Record.ToList(_), each _ "null" or each _ "")
      After this you can promote the headers and then follow the inconsistent header video.

  • @williamarthur4801
    @williamarthur4801 ปีที่แล้ว

    This may sound like a stupid question, and I'm sure it's something basic, but why do you get
    Name = Sheet , Data = Table, but I always have Name= table , Name = Sheet and adjacent
    Data = table, Data = table ? Oh, and loved the use of a condition for skip which I'd never thought of,
    even though now having looked it does say count or condition.

  • @swapna_learner
    @swapna_learner 7 วันที่ผ่านมา

    Could we have similar logic for bottom rows?

  • @Ratnakumarwrites
    @Ratnakumarwrites ปีที่แล้ว

    Super Video Chandeep.

  • @zdzislawkes
    @zdzislawkes หลายเดือนก่อน

    Hi, It's very smart solution. I'm looking for instruction, how to combine tables and not lose the columns that exist in the previous steps, in this case I would like the Name column to remain?

    • @GoodlyChandeep
      @GoodlyChandeep  หลายเดือนก่อน

      you'll find the answer in this video
      m.th-cam.com/video/oExuBdnHtrk/w-d-xo.html

    • @zdzislawkes
      @zdzislawkes หลายเดือนก่อน

      @@GoodlyChandeep Thank You very much. This is what I am looking. Can Yoy say what You think about this solution: th-cam.com/video/rCYn_onMP0I/w-d-xo.htmlsi=QYmkwRM2Cl1FuoCu

  • @denissipchenko2455
    @denissipchenko2455 ปีที่แล้ว +1

    Thanks for sharing!
    But looks like there should be List.ContainsAll instead of List.ContainsAny

    • @excel-in-g
      @excel-in-g ปีที่แล้ว

      Was thinking the same.

  • @arbazahmad7177
    @arbazahmad7177 ปีที่แล้ว

    Fantastic 🎉.. Thanks 😊

  • @RogerStocker
    @RogerStocker ปีที่แล้ว

    unbelievable crazy as usual.

  • @tiagocarvalhal4502
    @tiagocarvalhal4502 ปีที่แล้ว

    Incredible. Thanks :)

  • @MrKamranhaider0
    @MrKamranhaider0 ปีที่แล้ว

    JUST AMAZAING SUPERB

  • @gennarocimmino
    @gennarocimmino ปีที่แล้ว

    I would say simply amazing !!!!

  • @markdonaghy5397
    @markdonaghy5397 หลายเดือนก่อน

    I have an interesting use case. I have a base file with headers but the fifth file has had one additional column with headers added. As a result the process you have described breaks and for the last table I get the error "DataFormat.Error: There were more columns un the result than expected" in the CSV data column.
    I have been wrestling with this for a week and my research does not show any ways to manage this, although an append tables would seem to manage this.

    • @GoodlyChandeep
      @GoodlyChandeep  หลายเดือนก่อน

      send me your sample data and description of the problem - goodly.wordpress@gmail.com

  • @starprinceofficial9603
    @starprinceofficial9603 6 หลายเดือนก่อน

    For me my question if we need to bring the data before the columns as a new column before promoting headers, how do we go about it

  • @mohamedheltoukhy2355
    @mohamedheltoukhy2355 ปีที่แล้ว

    Amazing
    Thanks alot

  • @jimmckie3574
    @jimmckie3574 หลายเดือนก่อน

    Brilliant

  • @itgyantricks7218
    @itgyantricks7218 ปีที่แล้ว

    excellent

  • @abhijitmodak3461
    @abhijitmodak3461 9 หลายเดือนก่อน

    Thanks!

    • @GoodlyChandeep
      @GoodlyChandeep  9 หลายเดือนก่อน

      Thanks a lot Abhijit :)

  • @zeinh5139
    @zeinh5139 ปีที่แล้ว

    Wow ! thank you

  • @stefankirst3234
    @stefankirst3234 ปีที่แล้ว

    Really awesome!

  • @TomStewart-x1t
    @TomStewart-x1t 3 หลายเดือนก่อน

    I have a similar problem with a CSV file, there are title characters before the Column headings. How could I remove those?

  • @devendrareddynamballa1053
    @devendrareddynamballa1053 5 หลายเดือนก่อน

    What if we want to add back the removed rows after promoting the headers

  • @retamapark
    @retamapark 9 หลายเดือนก่อน

    Not as sophisticated, but say you had a table with two columns, Col1 and Col2. There are junk rows at the top. The row with headers has the values "Date" and "Amount". This seems for work and is easy to implement.
    let
    Source = Excel.CurrentWorkbook(){[Name="Table1"]}[Content],
    Custom1 = Table.Skip(Source, each [Col1] "Date" and [Col2] "Amount")
    in
    Custom1

    • @retamapark
      @retamapark 9 หลายเดือนก่อน

      fnTableSkipDynamic(Source, "Col1", "Date", "Col2", "Amount")
      Function to do this: Input column names as text, header values as text.
      (sourcetablename as table, col1name as text, header1value as text, col2name as text, header2value as text)=>
      let
      return = Table.Skip(sourcetablename,
      each
      ( Record.Field(_, col1name) header1value)
      and
      ( Record.Field(_, col2name) header2value)
      )

      in
      return

    • @GoodlyChandeep
      @GoodlyChandeep  9 หลายเดือนก่อน

      List.matchesall can look for both the headers. 👍

  • @babakmohammadi9931
    @babakmohammadi9931 ปีที่แล้ว

    could you possibly tell me what do i have to do with CSV files for "Table.TransformColumns(Source, {"Content", Excel.Workbook})" as that dosent work for CSV

  • @eslamfahmy87
    @eslamfahmy87 ปีที่แล้ว

    If the name & kind of data which extracted into PQ it's inconsistent and i need to filter out for all non needed sheets,
    How can work with that sheet

  • @huyuc6614
    @huyuc6614 9 หลายเดือนก่อน

    Hi i stuck on the step transform column. My file is .csv file not xlsx so when i use transformcolumn, it show error on the content. Do you know how to fix it

  • @markp8600
    @markp8600 ปีที่แล้ว

    Fabulous video , but it is difficult to see the "Applied Steps" at the end of the video. Question: what if the junk rows and "junk row data" are spread inconsistently through the spreadsheet. For example, the fund or department information may change resulting in blank rows between datasets and header rows when a new fund source or department is identified in the report. The example shows how to remove junk rows at the top of the report for 3 reports. Do you have any videos where the junk rows would be sporadically located throughout the report?

    • @GoodlyChandeep
      @GoodlyChandeep  ปีที่แล้ว +1

      Mark, I'll have to take a look at the data to give you possible ways to solving it.
      See if you can pick any tricks from this long video - th-cam.com/video/_ZKT1raC4P0/w-d-xo.html
      I've shared horizontal and vertical looping techniques in this video.

    • @markp8600
      @markp8600 ปีที่แล้ว

      @@GoodlyChandeep - Hi Chandeep, I could share a file with you on your website. I could upload on the PQ training course site. Would that work? Thanks for the great insights!

    • @markp8600
      @markp8600 ปีที่แล้ว

      @@GoodlyChandeep Perfect! Thank you so much Chandeep. Your help and guidance is greatly appreciated. Cheers!

  • @j_baisley_
    @j_baisley_ 8 หลายเดือนก่อน

    Damn awesome is right 👍

  • @bulbulahmed4414
    @bulbulahmed4414 ปีที่แล้ว

    Amazing

  • @ericliu79
    @ericliu79 หลายเดือนก่อน

    Great!

  • @hassanjatta4257
    @hassanjatta4257 ปีที่แล้ว

    Awesome!!!

  • @josealvesferreira1683
    @josealvesferreira1683 ปีที่แล้ว

    very nice

  • @oOBlindyOo
    @oOBlindyOo 3 หลายเดือนก่อน

    My source data is from pdf. Not excel.
    So the formula '=Table.TransformColumns(Source,{"Content", Excel.Workbook}) isn't working... any ideas?

  • @PandaVlademirBerlin
    @PandaVlademirBerlin 6 หลายเดือนก่อน

    What if i need the source.file column?

  • @ajay249
    @ajay249 ปีที่แล้ว

    Goodly is just too Godly.

  • @cdmkk2211
    @cdmkk2211 8 หลายเดือนก่อน

    How can I add files name as a column in this

  • @ankitachauhan5834
    @ankitachauhan5834 5 หลายเดือนก่อน

    How to do same thing but fro CSV file

  • @udayteja6595
    @udayteja6595 ปีที่แล้ว

    Great

  • @ankursharma6157
    @ankursharma6157 ปีที่แล้ว +1

    Token of Gratitude!

  • @MuridRealita
    @MuridRealita 21 วันที่ผ่านมา

    amzing

  • @carolshipley7903
    @carolshipley7903 4 หลายเดือนก่อน

    Hi. Can you give me away of doing this if there is more than one worksheet in the excel file and you only want to clean just one worksheet?

    • @GoodlyChandeep
      @GoodlyChandeep  4 หลายเดือนก่อน

      If you're connecting to a single xl file, you'll have to apply a filter before the Navigation Step to restrict the sheet names that you want.

  • @haroldmadrigal3671
    @haroldmadrigal3671 6 หลายเดือนก่อน

    it fails when there is #ref or formulas(lookup) in the junk rows

  • @deepraazshaw7369
    @deepraazshaw7369 ปีที่แล้ว

    Sir, can we get all these videos in Hindi?