The Secret to List.Accumulate in Power Query

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

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

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

    Be among the first 100 to jump on board "The Query Editor" newsletter 🚀. It's packed with super-actionable tips and insights. Why should you be excited? 🌟 Because the first 100 subscribers will receive an exclusive 50% discount on my upcoming mini-course, set to drop early next year (or perhaps even sooner)! 🤞Just hit this link to subscribe thequeryeditor.beehiiv.com/subscribe
    🚀🔥

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

    Why haven't I found this amazing channel before? Where have you been all my life?

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

      Thank you for your kind words! Please keep watching and if you would like to subscribe to my newsletter that would be wonderful as well! thequeryeditor.beehiiv.com/subscribe

  • @NilHunter
    @NilHunter Год назад +5

    Actually, the best way to understand how List.Accumulate() really works is treating 'state' as the object you're constructing and 'current' as the current item in the list passed in the function's 1st argument. 'start' is the initial object which from you'll begin to construct your desired object. For example, I have a list of names {"Bob Brown", "Ashley Hall", "Josh Parker", "Wesley Graham"} and I want to create a list of surnames from that. Using List.Accumulate(), we could get:
    let
    Source = {"Bob Brown", "Ashley Hall", "Josh Parker", "Wesley Graham"}
    SurnamesList = List.Accumulate(
    Source,
    {},
    (state as list, current as text) as list =>
    let
    SplittedName = Text.Split(current, " "), // List with name and surname
    Surname = SplittedName{1},
    SurnameAddedToState = List.InsertRange(state, List.Count(state), {Surname})
    in
    SurnameAddedToState
    )
    in
    SurnamesList
    In this code, I stressed the 'state' is a list and the 'current' is a text, because I want to construct a list of surnames based on the names in the Source list, starting from a empty list {}. You can name them as you please, but knowing it'll be always 2 arguments to the Accumulator function: the first being the object you're constructing whereas the second being the object from what you're manipulating to construct your desired object. The iterations are just as the following:
    1st iteration: state = {}, current = "Bob Brown";
    2nd iteration: state = {"Brown"}, current = "Ashley Hall";
    3rd iteration: state = {"Brown", "Hall"}, current = "Josh Parker";
    4th iteration: state = {"Brown", "Hall", "Parker"}, current = "Wesley Graham"
    Final Result = {"Brown", "Hall", "Parker", "Graham"}
    I hope I helped someone with this explanation.
    Sorry for my bad English btw

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

    This is really the BEST video which is available on youtube about List.Accomulate . Full of explanation.. Well Done! and waiting for the next video...👏👏👍

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

      Thank you for your kind words Zahoor! Much appreciated 😊

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

      Hi @Zahoor, here is the next video, enjoy 😊: ruclips.net/video/RyShRDv92EQ/видео.html

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

    One of the best intro to List.Accumate. Cristal clear!

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

      Thank you Roberto, I really appreciate the kind words!

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

    Best List.Accumulate explanation in RUclips!!

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

      Thank you so much, I really appreciate that!

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

    That four column table to help visualize things is brilliant!

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

      Really glad to hear it was helpful Brian!

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

    For the closing column (I refer to Excel file you showed at the beginning), an alternative solution to calculate accumulated value, or the running total is following formula, starting from row 2:
    =SUM($B$2,B2). If you drag and copy formula down, you will get the values from the Closing column. I know it might be too condensed for the concept you wanted to explain, but it is an alternative. Also, we love your English accent, it is simply delicious .

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

    Best illustration of how List.Accumulate works👍👍

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

      Thank you so much Kebin! Glad you enjoyed the video :)

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

    Big fan of your work. You explain list.accumulate gloriously!

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

      Thank you very much for your kind words, I really appreciate it!

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

    Wow, so many nuggets of gold in this video. (converting a column to a list by referencing the previous step was magic to me).
    This is the first time I've seen a video from your channel, and I am now a subscriber.

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

      Thank you, I’m so glad the video was helpful! And thank you so much for subscribing 😊.
      If you liked the conversion of the column to a list, maybe check out my Power Query Pro series, I show you more helpful tricks: ruclips.net/video/kqHMP0OzzBo/видео.html

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

    This is one of the best! Great video!!!

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

      Thank you Kenneth, really appreciate it!

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

    isn't there easy way to achieve running total by using List.Sum function?

  • @djkujo007
    @djkujo007 5 месяцев назад

    Very good! I got that to work but now I have to add logic so that only this only applies to the group of site ids and restarted for each site id. Not sure how to do that yet but will figure it out

  • @김현철-b3q
    @김현철-b3q 2 года назад

    I was really looking forward to watching this video

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

      I’m really glad to hear! Thank you for watching 😊

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

    Thank you for all the videos and i can wait the next video!

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

      You’re most welcome Florin! Thank you for your support. 😊

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

      Hi florin, here is the next video hope you enjoy 😊 ruclips.net/video/RyShRDv92EQ/видео.html

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

      @@MissMicrosoft thank you 😊

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

      You’re welcome!

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

    Very nice! Thanks for posting. Thumbs up!!

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

      You’re welcome Wayne! Thank you for always watching 😊

  • @Hello-bn2yc
    @Hello-bn2yc Год назад

    Awesome explanation...

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

    Why is your channel not bigger. This video is 🔥🔥🔥🔥

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

    This is awesome!

  • @MehediHasan-fz3zz
    @MehediHasan-fz3zz 2 года назад

    Thanks....💜

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

    How great explanation it is !

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

    hahsdhahah good