Using M to dynamically change column names in Power Query

Sdílet
Vložit
  • čas přidán 7. 09. 2024

Komentáře • 35

  • @controlsgirl
    @controlsgirl Před rokem +1

    Another great application walk through! I love how you split the video to show the smaller table and how to transform its contents into lists.

  • @gospelmoto2833
    @gospelmoto2833 Před rokem +1

    Great video. So much to catch up. But thanks for sharing.

  • @controlsgirl
    @controlsgirl Před rokem +1

    I also love how you explain the variables and the inner/outer environment

  • @aatsw
    @aatsw Před rokem +1

    Very well explained. Thanks.

  • @larmondoflairallen4705
    @larmondoflairallen4705 Před 3 lety +1

    I am blown away! You covered several situations that have always bugged me, things I knew were possible but I didn't know how to write the code for.

  • @udayteja6595
    @udayteja6595 Před rokem +1

    Very Helpful

  • @anatulyalmaimany
    @anatulyalmaimany Před 2 lety

    You are the best power query teacher on youtube!

  • @umeshkjadhav
    @umeshkjadhav Před 3 lety +2

    Nice Explanation.
    Goal and Steps.

  • @amitk1208
    @amitk1208 Před 2 lety +1

    Great video and very helpful . very nice way to explain

  • @mariaalcala5159
    @mariaalcala5159 Před 3 lety +1

    Great video! well explained and easy to follow!!

  • @malchicken
    @malchicken Před 3 lety +1

    Great video, well done. A possibility for another video segment: the different ways to stitch two lists together. I found most interesting the step of the custom column combining the two columns as lists into a combined list. It did make me wonder though, what are the different ways to combine lists together, like I’ve heard of a ‘zip’ function that can alternate values, but this is doing the same thing if those lists were expanded to rows?

    • @ExceedLearning
      @ExceedLearning  Před 3 lety +1

      Thank you for your idea, Hendrick!
      There is more than one possibility of combining lists in Power Query. One of them is the List.Zip() function that takes lists as arguments and returns a list of lists combining items at the same position.

    • @malchicken
      @malchicken Před 3 lety

      @@ExceedLearning looking forward to see what you come up with :) 👍

  • @zahir585
    @zahir585 Před 6 měsíci

    Brillante ❤thank you

  • @gopichand5017
    @gopichand5017 Před 3 lety +1

    Awesome..🔥🔥

  • @zaydarendse2812
    @zaydarendse2812 Před 3 lety +1

    wow thanks so much!!

  • @user-bh2lg4xw5n
    @user-bh2lg4xw5n Před 3 lety +1

    Awesome!

  • @TY-zl1vw
    @TY-zl1vw Před 3 lety +1

    Thank you for the video. I'm really new to the M language, this video really show there are concepts I need to pick up, for the whole Power Query in the matter of speaking.
    I found this video when seeking a possible way of automictically adding an attribute column using table's own name. I have query that already combined several tables scrapped from website. The table name would have something like '2017/2018', '2018/2019'... but content of each table themselves only include months, not the years. In the output I really want something like Jul 2017, Aug 2017....Jan 2018... Dec 2018... for further analysis. I did it manually so far, since that sample was only about 4 years worth individual months. But couldn't help wondering if there is a automatic way of doing it when data size gets large.
    I hope I'm making sense.

    • @ExceedLearning
      @ExceedLearning  Před 3 lety

      Hi,
      There is currently no way of referencing the table name inside of the query/table. To automatically add a year, there must be information at the website (or at least in the URL string) that points you to the year observed, which you could later use to add a custom column containing the year.

    • @TY-zl1vw
      @TY-zl1vw Před 3 lety

      Hi,
      Thanks for the reply. Yes, checking the website where tables come from, it’s possible to tell manually. I can load each tables into separate sheets using Power Query(so sheet names would reflect the table names). Then, with further steps, I can combine them into a summary sheet. I was just hoping a single query can do the job though.

    • @ExceedLearning
      @ExceedLearning  Před 3 lety

      @@TY-zl1vw Yes, it is possible to process the data of a similar structure in a single query. This can be achieved by creating a custom M function and using it upon the data. You can check our newest video to find out more about custom M functions.

  • @ddp2049
    @ddp2049 Před 8 měsíci

    i still don't get how to create dynamic columns so when the data comes in from the file it is automatically updated. it was a great video. I just stuck.

  • @extremeautomationwithajayp2131

    hi there. You know so much about M code. Congratulations for this. I want to ask you one thing which is bothering me so much. In table add column function, i am trying to create a code using list generate and i like to join two columns and this to be continued till i am not done with all columns. I have a challenge in using this table add column function , i want to create a new header everytime it joins the two columns. i see the new column which we write in this function as a name, cannot be a variable. so as a result, it has the same column name and not allowing to join the third and fourth column. Do you have any idea how we can make new column name dynamic so table add column fx should keep creating the new columns without duplicate error

  • @SamehRSameh
    @SamehRSameh Před 2 lety

    Please zoom in because of font is small

  • @nehakinitya57
    @nehakinitya57 Před 3 lety +1

    How can we create single step for replacing multiple values for example correction of city names

    • @ExceedLearning
      @ExceedLearning  Před 3 lety

      Hi, You might add those steps in a nested let expression.

  • @SpiritualMotto
    @SpiritualMotto Před 3 lety +1

    I need help on changing column name on daily to filter, when i first did my filter on my source column name is [xxx 25/10/2020] and filtered with "5" next day my column name is changed to [xxx 26/10/2020] when i refresh, it shows error like column is not found. Note: i dont want it to rename, i need source header as it is in output as well. I tried using table.columnnames(source){1} to filter based on column index instead of static column name as [xxx 25/10/2020] however, after refresh, it shows table is empty. There is no error but data is not getting populated. I need support to fix this.

    • @ExceedLearning
      @ExceedLearning  Před 3 lety +1

      Hi,
      I can think of 2 possible solutions which may help you:
      1. Use unpivot to get column name in the Attribute column and values in the Value column. Then, filter the Value column and pivot the Attribute column with the values from the Value column.
      2. Use Table.ColumnNames(Source) to get the column name of the selected column (in this case, the column you want to filter must always be the second column since you are accessing it with {1} (row index at PQ starts with 0).
      After this, filter the selected column with the help of Record.FieldName() function. The M code would be:
      ColName = Table.ColumnNames(Source){2},
      Filter = Table.SelectRows( Source, each Record.Field( _ , ColName ) = "5" )
      in
      Filter

    • @SpiritualMotto
      @SpiritualMotto Před 3 lety +1

      @@ExceedLearning You are Proved that your Mastered. You got new subscriber today. Its works very well.
      Also make video about this. Because i could find it across all platform

  • @MrDhunpagla
    @MrDhunpagla Před 3 lety +1

    Hi, I am facing expression error with the last column name in a file in which additional columns added recently. Whenever I refreshing the file in power query getting error since the column size increased by one. Please suggest how I can fix it ?

    • @ExceedLearning
      @ExceedLearning  Před 3 lety

      Hi, we have tested this solution and it should work regardless of the number of columns in the query. Be sure to check other steps you added since they might raise an error.

  • @caballero4321
    @caballero4321 Před 2 lety

    I got lost. Sir, at what point did you load Table1? Please explain further I appreciate your help in advance.

    • @caballero4321
      @caballero4321 Před 2 lety

      Well I did load a copy of my original table to use my new function but got an error as "Query expression error. We expected a Rename operations value. Details (List)....😭😭😭😭

    • @amenurasyid2849
      @amenurasyid2849 Před 2 lety

      @@caballero4321 same with me!! do you get the solutions yet?

  • @fadilyassin4597
    @fadilyassin4597 Před 2 lety

    hi
    you are not alone who does not supply the data to practice do you expect people to understand without practicing???????????????????????????????????????????supply THE DATA