Expand columns dynamically in Power Query (THE RIGHT WAY!) | Excel Off The Grid

Поделиться
HTML-код
  • Опубликовано: 23 ноя 2024

Комментарии • 59

  • @walteradamsbe
    @walteradamsbe 9 месяцев назад +4

    This method is great! Thanks for the tutorial.
    However, I recently discovered a necessary extra step to take to make sure it's done correctly. When anyone applies filters on the sheets you're importing, Excel (behind your back) creates additional hidden sheets in the workbook with names starting with "_xlnm._Filterdatabase". These will be listed in your query and if not filtered out, their data will be incorporated in the final result (resulting in double data).
    I've added an extra step after listing the tables stating "Name column should not begin with _xlnm" to filter these out before actually going into the steps which get the data from each indivisual sheet.
    Hope it helps for anyone

  • @stinhuffine4422
    @stinhuffine4422 9 месяцев назад +1

    You are the genius. First it requires out of the box, vivid thinking to feel it as a problem. Then it requires determination to make a video about it. And then it takes a pure one in Billion genius to make your solution as future proof as imaginable!

  • @VineshParekh
    @VineshParekh Год назад +3

    It makes your day when the first video appears from your search has the solution you're looking for. Great solution! Thank you

    • @ExcelOffTheGrid
      @ExcelOffTheGrid  Год назад

      And it's the weekend tomorrow!!! Surely that's too much good fortune for one day 😂

    • @VineshParekh
      @VineshParekh Год назад

      @@ExcelOffTheGrid Thank you & it's for sure but the weekend has more questions. Could you please advise how do I sort column headers dynamically that every time a new column is added, it gets sorted based on calendar month. For example, it should be sorted like Apr23, May23, Oct23, May24, May25 etc...

    • @ExcelOffTheGrid
      @ExcelOffTheGrid  Год назад +2

      @@VineshParekh
      In the final data, column headers should never be dates. As that is not a structured data layout. Dates are attributes about each record. Therefore you should have a month column with all the dates listed in that column.
      You should check out the unpivot feature to achieve that.

  • @wmcnabb
    @wmcnabb 9 месяцев назад +1

    Wow, this will be my new standard pattern for importing data from Excel. Thank you very much sir.

  • @ابوالايهمالصادق
    @ابوالايهمالصادق 9 месяцев назад +2

    ماشاء الله تبارك الله شرح رائع وجميل ومشكور جدا وربنا يهديك ان شاء الله

  • @ahdianpuguh
    @ahdianpuguh 9 месяцев назад +1

    Man.. I learn this for hours.. Thank a lot..

  • @LaloinLondon
    @LaloinLondon Год назад +2

    I have seen quite a few videos about expanding columns dynamically, but yours is the best so far. Thanks for sharing.

  • @kevinmc2000YT
    @kevinmc2000YT Месяц назад +1

    Thanks for all the knowledge shared!

  • @Sumanth1601
    @Sumanth1601 Год назад +4

    Brilliant 😮 I really loved the way you showed in detail what can go wrong first. These are real scenarios we came across. Excellent

    • @ExcelOffTheGrid
      @ExcelOffTheGrid  Год назад

      Thanks Sumanth, I really appreciate that feedback. 😁

  • @ziggle314
    @ziggle314 Год назад +1

    Absolutely superb. Thanks Mark! I love videos where I pick up techniques that I can apply immediately.

    • @ExcelOffTheGrid
      @ExcelOffTheGrid  Год назад

      Great news. I'm glad you can put it to use straight away. ✅

  • @iankr
    @iankr 7 месяцев назад +1

    Great techniques there, Mark. Many thanks.

    • @ExcelOffTheGrid
      @ExcelOffTheGrid  7 месяцев назад

      You’re welcome, glad it was helpful. 😁

  • @IvanCortinas_ES
    @IvanCortinas_ES Год назад

    Great tutorial Mark. Learning from a great teacher. Thank you!!

  • @GrainneDuggan_Excel
    @GrainneDuggan_Excel Год назад

    slick solution Mark and not too tough to implement for the MCode beginner

  • @jeromeastier462
    @jeromeastier462 4 месяца назад

    This is awesome! Thanx for sharing your knowledge

  • @mirrrvelll5164
    @mirrrvelll5164 10 месяцев назад +1

    Great one! Very useful!

    • @ExcelOffTheGrid
      @ExcelOffTheGrid  10 месяцев назад

      Glad you think so! I find it comes in handy quite often.

  • @michaelpavlov9493
    @michaelpavlov9493 11 дней назад

    Nice! Thank You!

  • @huseyinburaktasci1638
    @huseyinburaktasci1638 7 месяцев назад

    amazing solution!! thank you!

  • @jist6953
    @jist6953 Год назад +2

    Excellent, thank you. Does this capture column field name changes as well?

    • @ExcelOffTheGrid
      @ExcelOffTheGrid  Год назад

      Yes, it would. However if you've got other steps based on those column names (e.g. Change Type), then it will cause an query error.

  • @alterchannel2501
    @alterchannel2501 Год назад +1

    Amazing trick👏👏👏

  • @markdhenderson1
    @markdhenderson1 18 дней назад

    What about the hardcoded column names when you defined the data type? Is there any way to make that dynamic?

  • @FRANKWHITE1996
    @FRANKWHITE1996 Год назад +1

    thanks for sharing

  • @kevingodsave8893
    @kevingodsave8893 6 месяцев назад +1

    I hope the Excel team will create GUI solution to handle dynamic changes

    • @ExcelOffTheGrid
      @ExcelOffTheGrid  6 месяцев назад

      It would be nice, but I think it’s unlikely.

  • @panksimus
    @panksimus 2 месяца назад

    I have 2 columns. Second column has tables. But I want to expand them into columns. By default, it'll always add extra rows and spill the data. What if I want my data to spill into multiple columns? Is there an option to do that?

  • @chrisberardi2304
    @chrisberardi2304 3 месяца назад

    What was missing in this tutorial was looking at the overall steps. I lost track of what query you were working on and what step was being created or edited. Maybe it was off screen and wasn't captured in the video?

  • @tlee7028
    @tlee7028 Год назад +1

    Awesome 👏

  • @bernardo01233211
    @bernardo01233211 Год назад

    Niceeee! Thank you very much! I have question, is there any workaround for "Combine Files" from a folder/sharepoint?

    • @ExcelOffTheGrid
      @ExcelOffTheGrid  Год назад

      What kind of work around?
      You can combine files from a folder in SharePoint, what’s the issue?

  • @Ypurenete
    @Ypurenete Год назад +1

    Muito bom!!

  • @RichardJones73
    @RichardJones73 6 месяцев назад

    Genius

  • @chrisa8203
    @chrisa8203 Год назад

    9:40 what would you do if the row headers is in row 3?
    Think I need a combination of Promote Headers + Skip First 2 rows…I’m stuck haha

    • @ExcelOffTheGrid
      @ExcelOffTheGrid  Год назад

      I would transform the nested Table before expanding. Watch this video:
      ruclips.net/video/UaPrpQOchFI/видео.html

    • @chrisa8203
      @chrisa8203 Год назад +1

      @@ExcelOffTheGrid thanks for the quick reply! I was able to solve with formula below…basically wrap PromoteHeaders w/TableSkip
      Table.PromoteHeaders(Table.Skip(_,2), [PromoteAllScalars=true])

  • @VineshParekh
    @VineshParekh Год назад

    Hello,
    I have few columns and I want to sort columns based on the month & Year. For example, 0723, 0823, 1023, 0124 etc..
    My data is connected to a folder so everytime a new PDF is added with MMYY, the data will add a new column for that month.
    For example, I have columns below.
    Name, Category, Serial Number, then months 0723, 0823, 1023, 0124, Total
    So I want to keep all the columns as it and the month columns should be sorted as the earliest month should appear first. Could you please help me with this solution? I have been searching from few days with no solution found so far.

    • @ExcelOffTheGrid
      @ExcelOffTheGrid  Год назад +1

      Needing to have columns in a specific order is an indication that you’re using Power Query as a presentational tool instead of a data preparation tool.
      While it is possible, I don’t think it’s the right solution as you’ll still end up with issues later in the process.

  • @kebincui
    @kebincui 11 месяцев назад

    👍👍

  • @prashantsuthar7
    @prashantsuthar7 Год назад +1

    Help me thanks

  • @victor_wang_1
    @victor_wang_1 Год назад +2

    You did all those additional steps to keep the column flowing in dynamically...BUT then...Table.TransformColumnTypes hard codes them all again! So any new column won't have a data type attached to it. I've come to accept that Power Query is simply not good at these sorts of tasks. The amount of hoops you have to jump through to avoid hard coding column names gets ridiculous rather quickly. Honestly, if the number of columns changes so much, you may be better off using an EAV model via unpivoting.

    • @ExcelOffTheGrid
      @ExcelOffTheGrid  Год назад +6

      Visibility of new data is 99% of the problem. Once you know it’s there you can decide what to do with it.
      We’ve got a separate solution for dealing with data types dynamically. But that is outside the scope of this video.
      The less uniformity in data sets the more complex the solution to clean it. That’s just life.