Dynamically expand table column in Power Query (advanced)

Поділитися
Вставка
  • Опубліковано 24 лис 2024

КОМЕНТАРІ • 38

  • @wayneedmondson1065
    @wayneedmondson1065 2 роки тому +4

    This is great! Thanks for the awesome lesson. Note that it is possible by slightly modifying your single table method to account for multiple tables using List.Union in the Table.Expand step, as follows: = Table.ExpandTableColumn(#"Removed Other Columns", "Data", List.Union(Table.AddColumn(#"Removed Other Columns", "ColumnNames", each Table.ColumnNames([Data]))[ColumnNames]), List.Union(Table.AddColumn(#"Removed Other Columns", "ColumnNames", each Table.ColumnNames([Data]))[ColumnNames]). This will give you the same result as your method and dynamically handle column changes to any of the source tables. If you want, you can also wrap the List.Union construction with List.Sort to get the columns sorted left to right either ascending or descending with the Order.Ascending or Order.Descending argument inside List.Sort. Just another way to get there. Thanks for sharing your tips! Learned a lot. Thumbs up!!

    • @ExceedLearning
      @ExceedLearning  2 роки тому +2

      Hi Wayne,
      A nice way of doing the dynamic expansion of the columns, thanks for sharing!

    • @wayneedmondson1065
      @wayneedmondson1065 2 роки тому +1

      @@ExceedLearning Glad to contribute! Cheers!!

    • @spilledgraphics
      @spilledgraphics 2 роки тому +1

      @@wayneedmondson1065awesome seeing on this channel as well !

    • @wayneedmondson1065
      @wayneedmondson1065 2 роки тому

      @@spilledgraphics Cool! Cheers!!

  • @Hacks_at_work
    @Hacks_at_work 11 місяців тому

    i would like to say big big thank you. i stuck in power query exactly i am facing like this problem. i search a lot in you tube finally your video solve my problem.

  • @fcoatis
    @fcoatis 3 роки тому +2

    This channel is exactly what I was looking for. Thank you

  • @malchicken
    @malchicken 3 роки тому +2

    Very concise and understandable, thank you for being so clear. The “hold Alt to open a second excel” trick alone will save me many hours of frustration :D I have watched many videos, but never seen that mentioned before. Thank you!

    • @ExceedLearning
      @ExceedLearning  3 роки тому +1

      It also bothered us a lot, and were quite amazed when we would out about this feature!

  • @FarshidMeidani
    @FarshidMeidani Рік тому

    Hi , You can use CTRL, SHIFT, +/- to zoom in / out power query editor or advanced editor , And this useful when you recording these videos.

  • @ALex-fp2zx
    @ALex-fp2zx Рік тому

    Thank you! Your chanel ist the very useful for andvanced stady of POwer Query! Coll technuques!

  • @Alan.DL7
    @Alan.DL7 3 роки тому +1

    Great tip. I have used some similar technique which it's using the same logic as end result but it took me way more steps than yours. I have a weekly report with 52 rolling weeks meaning that for each new report, 1 week will disappear and a new one will be added. It was a headache to have it solved! But, for sure I will be replacing mine with this solution :)

  • @syedaneesdurez9880
    @syedaneesdurez9880 2 роки тому

    Hello, Thanks for sharing this technique. Amazing..

  • @paspuggie48
    @paspuggie48 3 роки тому +1

    Fantastic tip to open another excel workbook. I never you could do that 👌

    • @ExceedLearning
      @ExceedLearning  3 роки тому +1

      Thank you Paul, that's one of the best tricks we've learned about PQ in Excel so far!

    • @paspuggie48
      @paspuggie48 3 роки тому +1

      @@ExceedLearning I've been using it for 2 years and watched and read so many articles in my time and that is the first time I've known about this. So thank you so much for sharing :)

    • @paspuggie48
      @paspuggie48 3 роки тому +1

      And you can open 2 instances of the Query Editor too..woohoo

  • @rick_.
    @rick_. 2 роки тому

    I like your channel, very informative! For this sort of thing I like to use Table.Combine and pass in the name of the column holding the tables.

  • @nishantkumar9570
    @nishantkumar9570 3 роки тому +1

    It's really awesome amd informative. Thank you very much.

  • @qasimjan5258
    @qasimjan5258 3 роки тому +1

    Hi friend. Thank you so much for sharing your knowledge with us. Could you also do a video on " Dynamically expanding table rows".

    • @ExceedLearning
      @ExceedLearning  3 роки тому

      Hi, thank you for your comment!
      Could you please explain in more detail what do you mean by dynamically expanding rows?

  • @kennethstephani692
    @kennethstephani692 2 роки тому

    Great video!

  • @cosladacity1
    @cosladacity1 2 роки тому

    you are a genius man!! id love to invite you a beer now ;)

  • @antoniofelez4674
    @antoniofelez4674 4 місяці тому

    What if I want to do other transformation on the nested tables before expanding?

  • @zaydarendse2812
    @zaydarendse2812 3 роки тому +1

    amazing! thanks for sharing

  • @MehmetAliMD
    @MehmetAliMD 3 роки тому

    Thank you so much. How about if I wanna dynamically expand the table columns from different excel or CSV files?

  • @joseeduardoacostarodriguez3031
    @joseeduardoacostarodriguez3031 2 роки тому +1

    Excelente, no se inglés y lo entendí perfectamente. Una solución K.I.S.S.

  • @vladtolievich8039
    @vladtolievich8039 3 роки тому +1

    Hello, thanks for sharing this technique. But I just tested it and realized that comparing to regular (hard coded and not dynamic) column expansion way, this is too slow. My refresh took almost one minute instead of 20 seconds for 2161 rows and 36 columns (also i had to convert column list into table and back to list in order to filter out some not needed columns). But still interesting.

    • @ExceedLearning
      @ExceedLearning  3 роки тому

      Hi Vlad, thanks for the input. Like we mentioned in the video, this technique won't always produce better results. I'm guessing it would be faster in case you need to pivot only a few columns and w/o any intermediate steps, but we haven't tested it enough to have a general approach on when exactly to use it compared to a regular Pivot.

  • @retamapark
    @retamapark Рік тому

    Nice!

  • @SamehRSameh
    @SamehRSameh 2 роки тому +1

    Scrren is very small plz zoom in

  • @KoolGuyism
    @KoolGuyism Рік тому

    How can I expand columns without using any code..or.. can you give this code in writing as i am not good with codes.

  • @kebincui
    @kebincui Рік тому

    Super ❤

  • @amani1997
    @amani1997 3 роки тому

    Wow thanks

  • @SaniGarba
    @SaniGarba 3 роки тому +1

    Thanks

  • @Softwaretrain
    @Softwaretrain 3 роки тому +1

    Thanks but you did it in a long way, simple and easy way is useing Table.Combine function.

    • @ExceedLearning
      @ExceedLearning  3 роки тому +2

      Hi,
      Thank you for your comment! :)
      This technique describes a solution to dynamic table column expansion, not combining tables. The three tables used in the video are just for demonstration purposes, i.e. for demonstrating how to expand all columns dynamically when nested tables are different. This is applicable in many different scenarios such as merging, invoking custom functions, processing folders, etc. In those scenarios, we cannot append the tables with Table.Combine, but we need to expand the column that contains nested tables.
      You can see another use case (merging queries) in our previous video: ua-cam.com/video/ipRQONz4GOE/v-deo.html