Dynamically Re-Order Columns in Power Query

Поділитися
Вставка
  • Опубліковано 6 лют 2024
  • In this video, you will learn how to dynamically reorder columns in Power Query, whether you're working in Excel or Power BI. Learn how to create a user interface that allows you to define the positions of the columns, giving the user greater control and flexibility.
    #powerquery #datacleaning #dataanalysis
    ===== ONLINE COURSES =====
    ✔️ Mastering DAX in Power BI -
    goodly.co.in/learn-dax-powerbi/
    ✔️ Power Query Course-
    goodly.co.in/learn-power-query/
    ✔️ Master Excel Step-by-Step -
    goodly.co.in/learn-excel/
    ✔️ Business Intelligence Dashboards-
    goodly.co.in/learn-excel-dash...
    ===== LINKS 🔗 =====
    Blog 📰 - www.goodly.co.in/blog/
    Corporate Training 👨‍🏫 - www.goodly.co.in/training/
    Need my help on a Project 💻- www.goodly.co.in/consulting/
    Download File ⬇️ - goodly.co.in/dynamic-column-r...
    ===== 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!
  • Наука та технологія

КОМЕНТАРІ • 56

  • @GoodlyChandeep
    @GoodlyChandeep  6 місяців тому

    Download the file ⬇ - goodly.co.in/dynamic-column-re-ordering-power-query
    Tackle even the most challenging data-cleaning problems. Check out the M Language course and push beyond the user interface ↗ - rb.gy/a2zsnn

  • @AlesKus
    @AlesKus 6 місяців тому +6

    Dear Chandeep! It was really a pleasure to meet you at GES today! As mentioned - you are best! Thank you for all your shared work!

    • @we.visuals
      @we.visuals 5 місяців тому

      What is GES?

    • @AlesKus
      @AlesKus 5 місяців тому

      Global excel summit

    • @YvesAustin
      @YvesAustin 5 місяців тому

      How did Chandeep teleport back home so fast? lol

    • @chandeepchhabra
      @chandeepchhabra 5 місяців тому

      ​@@YvesAustinM still in London. The video is was recorded earlier and scheduled😅

  • @hellorich714
    @hellorich714 5 місяців тому

    Brilliant. Absolutely brilliant. Thank you. So helpful

  • @ziggle314
    @ziggle314 6 місяців тому +1

    This solves a problem I am dealing with right now. Thanks!

  • @natallia1
    @natallia1 6 місяців тому

    This is awesome! Brilliant as always.

  • @darcyg852
    @darcyg852 2 місяці тому

    Thank you! This was so helpful!

  • @whizzohk
    @whizzohk 6 місяців тому

    Extremely useful as always Chandeep! No hard-coded column names is the key to flexible models.

  • @natashailina5005
    @natashailina5005 5 місяців тому

    Great video as usually! Thanks a lot

  • @chrism9037
    @chrism9037 6 місяців тому

    Very clever , thanks Chandeep!

  • @shreedharan.moorthy
    @shreedharan.moorthy 5 місяців тому

    Very interesting and useful. Thank you so much.

  • @eddiel6608
    @eddiel6608 5 місяців тому

    Great lesson, thank you

  • @zahir585
    @zahir585 6 місяців тому

    Brilliant, thank you

  • @IvanCortinas_ES
    @IvanCortinas_ES 5 місяців тому

    Excellent explanation. Thank you Chandeep!!

  • @DavidTraynier
    @DavidTraynier 5 місяців тому

    Really smart solution and clear explanation.

  • @ericrobbins6953
    @ericrobbins6953 5 місяців тому

    Very creative!

  • @PankajSingh-mk9wk
    @PankajSingh-mk9wk 5 місяців тому

    Hello Chandeep, I have been following your content for one and a half year, really want to do your course but the course I want to do is very expensive. But the really good stuff keeps it going.

  • @ExcelUnlocked
    @ExcelUnlocked 5 місяців тому

    Amazingly helpful

  • @Bhavik_Khatri
    @Bhavik_Khatri 6 місяців тому

    Awesome Tutorials

  • @briandennehy6380
    @briandennehy6380 5 місяців тому

    Lovely stuff

  • @mecorowa5642
    @mecorowa5642 5 місяців тому +1

    With a self reference from the new table on the sheet, it is possible to keep it dynamic when further columns get added.

  • @sskdev5116
    @sskdev5116 2 місяці тому

    My God!!! This was something I was looking for

  • @krishanphophalia9303
    @krishanphophalia9303 5 місяців тому

    Awesome ❤

  • @hichamezznati2646
    @hichamezznati2646 5 місяців тому

    Very interesting .Thank you . here is an other tip i'd like to share that gives the same result, using List.Sort and without using the user interface :
    let
    Input = Cols1,
    Col = Input[Cols],
    Pos = Input[Postion No],
    ColSortingOrder = List.Reverse(
    List.Sort(
    Col,
    (x, y) =>
    Value.Compare(
    let
    Px = List.PositionOf(Col, x)
    in
    1 / Pos{Px},
    let
    Py = List.PositionOf(Col, y)
    in
    1 / Pos{Py}
    )
    )
    )
    in
    Table.ReorderColumns(Personnalisé1, ColSortingOrder)

  • @jaybuddhadev3543
    @jaybuddhadev3543 6 місяців тому

    always best👍

  • @justinwduff
    @justinwduff 5 місяців тому

    Excellent video, it's hard to find high quality M content. Pleasure meeting you @ GES, great presentation!

  • @vishnupp5944
    @vishnupp5944 3 місяці тому

    Great

  • @shadimanci
    @shadimanci 6 місяців тому

    How is this awesome ❤❤❤

  • @sabarashid1513
    @sabarashid1513 5 місяців тому

    That was extremely useful. I have one question - will the order be maintained when loaded to Power BI. If not, how to maintain the column orders when data is loaded from Power Query to Power BI. Any guidance would be helpful.

  • @mukeshrawat2621
    @mukeshrawat2621 5 місяців тому

    @goodly if you know Hindi , please share, it very useful understanding lots of people

  • @EricHartwigConsulting
    @EricHartwigConsulting 5 місяців тому

    This is very awesome! Thank you for creating/sharing!
    I am curious what are your thoughts on first sorting by position number and then alphabetically sorting the first column to give some kind of pattern to the query should the column names change?

  • @ramandeepsr
    @ramandeepsr 6 місяців тому

    ❤❤

  • @datalearningsihan
    @datalearningsihan 6 місяців тому

    I was thinking of purchasing your power query course. Is your courses regularly updated?

  • @ExcelWithChris
    @ExcelWithChris 6 місяців тому

    Do you have to refresh twice? First refresh will create the list for the user to type in the order and the next refresh will then do the job?

  • @osamaabd-elmohsen6427
    @osamaabd-elmohsen6427 6 місяців тому

    Hi,
    Could you make a video how we can dynamic expand monthly aggregated columns when we are merging queries, Regards

  • @Ypurenete
    @Ypurenete 5 місяців тому

    Very good video. Congfats!!
    I have a problem, but a little diferent. There is a table with columnNames A, B, C and Another table without headers Column1, Column2, Column3. How can I append these tables?

    • @dabrain6944
      @dabrain6944 5 місяців тому +1

      The second table actually has column headers, but they are generic. You can simply rename them before appending.
      let
      Table1 = TableABC,
      Table2 = TableC1C2C3,
      RenamedHeadersTable2 = Table.RenameColumns(Table2, List.Zip({Table.ColumnNames(Table2), Table.ColumnNames(Table1)}),
      AppendedTable2 = Table.Combine({Table1, RenamedHeadersTable2})
      in
      AppendedTable2

    • @Ypurenete
      @Ypurenete 5 місяців тому

      @@dabrain6944 thanks a lot!!

  • @workstuff5253
    @workstuff5253 5 місяців тому

    In Power BI it doesn't seem to matter what order you put the columns in. The table view sticks them in any order it feels like! Which sucks.

  • @azlanm0305
    @azlanm0305 Місяць тому

    👋👋👋👍👍👍👍

  • @jerrydellasala7643
    @jerrydellasala7643 6 місяців тому

    Very cool! BTW, the download link isn't working.

    • @GoodlyChandeep
      @GoodlyChandeep  6 місяців тому

      goodly.co.in/dynamic-column-re-ordering-power-query

  • @michaelt312
    @michaelt312 6 місяців тому +1

    How would this be impacted if column names change? Say % becomes Percent. Or a real world example, a list of employees. Someone changes their last name. Or someone leaves.

    • @Sternpkbjo
      @Sternpkbjo 6 місяців тому +1

      Yah good question

    • @dabrain6944
      @dabrain6944 6 місяців тому

      If the columns remain in the same order, this shouldn't affect the query, as long as you refresh the Cols-Query prior to loading the resulting query.

  • @gef24
    @gef24 6 місяців тому +3

    Instead of replacing null, I filter out null.

    • @Ratnakumarwrites
      @Ratnakumarwrites 6 місяців тому

      Then your columns will also disappear... Correct me if i am wrong...

    • @dabrain6944
      @dabrain6944 6 місяців тому

      No, they will not dissappear. But their order remains as it is. So it would really be better to filter out the nulls.

    • @Ratnakumarwrites
      @Ratnakumarwrites 5 місяців тому

      I meant rows...

    • @dabrain6944
      @dabrain6944 5 місяців тому +1

      They are actually not needed to make the query work.

  • @edsta714
    @edsta714 6 місяців тому

    I can’t believe you cant reorder the columns in go to columns. A simple move up or down button or drag and drop from the vertical list would be so much easier.

    • @Sternpkbjo
      @Sternpkbjo 6 місяців тому

      His technique is useful if you have a lot of columns to organize