Power Query (Excel) + M Code | List.Accumulate; Table.ReplaceValue

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

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

  • @rajeshbadola4728
    @rajeshbadola4728 2 года назад

    Can't beleive ! List.accumulate is clarified within 4 minutes with complete details. Great ! Enjoyed an understanding to the function....

  • @مسلم_سني_مسلم
    @مسلم_سني_مسلم 2 года назад +1

    Excellent 👍👍👍

  • @StefanoVerugi
    @StefanoVerugi 2 года назад

    power query at a different level, super thanks

    • @bsmart2gether408
      @bsmart2gether408  2 года назад

      Thank you Stefano. Feel free to ask any questions if the contents is not clear.

    • @StefanoVerugi
      @StefanoVerugi 2 года назад

      @@bsmart2gether408 the content requires attention due to its level but you made it easy to follow, thanks again for posting it

  • @Sumanth1601
    @Sumanth1601 2 года назад +1

    Excellent content 👍🙂

    • @bsmart2gether408
      @bsmart2gether408  2 года назад

      Thank you Sumanth. Is there particular thing you expect from List.Accumlate or I missed?

    • @Sumanth1601
      @Sumanth1601 2 года назад +1

      @@bsmart2gether408 Yes this was a nice example. It's an amazing but complex function. May be more example on how we can apply this will be helpful 🙂 like looping thru each column.. looping thru tables to find a particular value.just more examples will be great 🙂👍

    • @bsmart2gether408
      @bsmart2gether408  2 года назад

      Hi Sumanth, thank you for your view. Let me have a think what other examples best for loops.

  • @UlyssesHaq
    @UlyssesHaq 2 года назад +1

    Id love how to use List.Accumulate to add multiple columns! Do you have any plans to give a tutorial on that? That would be amazing. Love this channel and your content! Looking forward to more

    • @bsmart2gether408
      @bsmart2gether408  2 года назад +2

      Hi Imran Haq, Thank you so much for your lovely comment. I would definitely love to create another video to cover more examples of how to use List.Accumulate. I have added to my list. For the time being, assume you have a column name [Amount] and want to calculate a number of discounts (5%, 10%, 15%). The code for List.Accumulate: List.Accumulate({0..3-1}, PrevStepName, (x,y)=> Table.AddColumn(x, "Discount"&Text.From(y), each [Amount] * {0.05,0.1,0.15}{0})). The 3 in the code is the count of the number of discount %).

    • @bsmart2gether408
      @bsmart2gether408  2 года назад +1

      Hi Imran Haq, The latest video covered add multi columns. Let me know if it makes sense to you. Also, feel free to ask questions.

    • @UlyssesHaq
      @UlyssesHaq 2 года назад +1

      @@bsmart2gether408 Thank you so much for replying to my request, that is super kind! Im so immensely grateful! Ive just watched it... This method is incredibly useful!

    • @bsmart2gether408
      @bsmart2gether408  2 года назад

      I'm glad it helps 😄

    • @bsmart2gether408
      @bsmart2gether408  2 года назад

      I'm glad it helps 😄

  • @smartwork4768
    @smartwork4768 2 года назад +1

    Great thank you

  • @SamehRSameh
    @SamehRSameh Месяц назад

    I Need check first row in final column if negative , sum it with second row in column1
    Then repeat steps till reach positive value in final column and put value in column1 in final column

  • @mirrrvelll5164
    @mirrrvelll5164 2 года назад +1

    Good video as usual!!! One thing, I think you said you are taking also questions and similar things (help) - can you make one video how to compare two tables in PQ and get "3rd" query where you can see the differences? I think that is definitely something that comes very very often on the way =)

    • @bsmart2gether408
      @bsmart2gether408  2 года назад +2

      Hi @mirrr velll, not a problem at all. I am always happy to share my knowledge. To ensure I get your thought right, we are looking to compare the entire two tables? if not, would you mind to provide me a bit more information? This will help me to mock up the data.

    • @mirrrvelll5164
      @mirrrvelll5164 2 года назад

      @@bsmart2gether408 Of course, hmm lets say I had that question 2 days ago. Imagine you have T1(table =)) with 3x columns and another T2 with 5x columns, and you wanna do compare for only 3x columns.
      What I did is: = Table.RemoveMatchingRows(SQLUsers,Table.ToRecords(AdminPortalUsers))
      The result is T where you can find missing values from T2...
      Here in my T's is only 1x column but you can also define after before last bracket an array for specific columns - I only know the names has to be same!

    • @bsmart2gether408
      @bsmart2gether408  2 года назад +1

      Noted. Let me have a think and mock up something.

    • @UlyssesHaq
      @UlyssesHaq 2 года назад

      @@mirrrvelll5164 consider using function, Table.ColumnNames() on T1. This will give a list of column names, keep this as a variable. Then for T2 use Table.SelectColumns() and use ur T1 column names variable as the list of columns argument. That way, T2 will always keep only the same columns that exist in T1

    • @mirrrvelll5164
      @mirrrvelll5164 2 года назад +1

      @@UlyssesHaq You are right but if we are talking about columns differences, but I mentioned "differences within columns, so values"...but this is also useful