The Secret to List.Accumulate in Power Query

แชร์
ฝัง
  • เผยแพร่เมื่อ 8 ก.ย. 2024
  • List.Accumulate is an extremely powerful function in Power Query, watch this video to understand exactly how it works and how to use this List function.
    Please download the practice file here: docs.google.co...
    ✅ Please see link to videos mentioned in this video:
    🎦 How to Calculate Running Totals in Power Query - • How to Calculate Runni...
    🎦 Power Query Advanced Editor - What Is It and How to Use It? - • Getting Started with t...
    ✅ If you would like to connect on LinkedIn:
    🤝 www.linkedin.com/in/missmicrosoft
    ✅ If you would like to support the channel by buying me a coffee, (it's really quick and easy), please use this link:
    ☕www.buymeacoff...
    ✅ For more videos please subscribe:
    🔔 / @missmicrosoft
    ✅ Please also check out my Excel course on Udemy, please use this link:
    📖 www.udemy.com/...

ความคิดเห็น • 44

  • @MissMicrosoft
    @MissMicrosoft  10 หลายเดือนก่อน +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
    🚀🔥

  • @zahoorsarbandi2982
    @zahoorsarbandi2982 ปีที่แล้ว +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  ปีที่แล้ว

      Thank you for your kind words Zahoor! Much appreciated 😊

    • @MissMicrosoft
      @MissMicrosoft  ปีที่แล้ว

      Hi @Zahoor, here is the next video, enjoy 😊: th-cam.com/video/RyShRDv92EQ/w-d-xo.html

  • @nil.hunter
    @nil.hunter ปีที่แล้ว +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

    • @MissMicrosoft
      @MissMicrosoft  ปีที่แล้ว

      Thank you this is well explained!

  • @romulusmilea2747
    @romulusmilea2747 7 หลายเดือนก่อน

    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 .

  • @FredrikDahlberg
    @FredrikDahlberg 10 หลายเดือนก่อน

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

    • @MissMicrosoft
      @MissMicrosoft  10 หลายเดือนก่อน

      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

  • @RobertoStaltari
    @RobertoStaltari ปีที่แล้ว

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

    • @MissMicrosoft
      @MissMicrosoft  ปีที่แล้ว

      Thank you Roberto, I really appreciate the kind words!

  • @brianxyz
    @brianxyz ปีที่แล้ว +1

    That four column table to help visualize things is brilliant!

    • @MissMicrosoft
      @MissMicrosoft  ปีที่แล้ว

      Really glad to hear it was helpful Brian!

  • @kebincui
    @kebincui ปีที่แล้ว +1

    Best illustration of how List.Accumulate works👍👍

    • @MissMicrosoft
      @MissMicrosoft  ปีที่แล้ว

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

  • @SiraEkabutPlus
    @SiraEkabutPlus ปีที่แล้ว

    Best List.Accumulate explanation in TH-cam!!

    • @MissMicrosoft
      @MissMicrosoft  ปีที่แล้ว

      Thank you so much, I really appreciate that!

  • @basensei8699
    @basensei8699 10 หลายเดือนก่อน

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

    • @MissMicrosoft
      @MissMicrosoft  9 หลายเดือนก่อน

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

  • @djkujo007
    @djkujo007 2 หลายเดือนก่อน

    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

  • @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: th-cam.com/video/kqHMP0OzzBo/w-d-xo.html

  • @khangtranstation
    @khangtranstation 8 หลายเดือนก่อน

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

  • @kennethstephani692
    @kennethstephani692 ปีที่แล้ว

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

    • @MissMicrosoft
      @MissMicrosoft  ปีที่แล้ว

      Thank you Kenneth, really appreciate it!

  • @KamranMumtazAhmed
    @KamranMumtazAhmed 4 หลายเดือนก่อน

    This is awesome!

  • @user-rb5jp8yf9q
    @user-rb5jp8yf9q ปีที่แล้ว

    I was really looking forward to watching this video

    • @MissMicrosoft
      @MissMicrosoft  ปีที่แล้ว

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

  • @Hello-bn2yc
    @Hello-bn2yc ปีที่แล้ว

    Awesome explanation...

  • @wayneedmondson1065
    @wayneedmondson1065 ปีที่แล้ว

    Very nice! Thanks for posting. Thumbs up!!

    • @MissMicrosoft
      @MissMicrosoft  ปีที่แล้ว +1

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

  • @florincopaci6821
    @florincopaci6821 ปีที่แล้ว

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

    • @MissMicrosoft
      @MissMicrosoft  ปีที่แล้ว +1

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

    • @MissMicrosoft
      @MissMicrosoft  ปีที่แล้ว +1

      Hi florin, here is the next video hope you enjoy 😊 th-cam.com/video/RyShRDv92EQ/w-d-xo.html

    • @florincopaci6821
      @florincopaci6821 ปีที่แล้ว

      @@MissMicrosoft thank you 😊

    • @MissMicrosoft
      @MissMicrosoft  ปีที่แล้ว

      You’re welcome!

  • @user-xc1ce3cd3f
    @user-xc1ce3cd3f 9 หลายเดือนก่อน +1

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

  • @MehediHasan-fz3zz
    @MehediHasan-fz3zz ปีที่แล้ว

    Thanks....💜

    • @MissMicrosoft
      @MissMicrosoft  ปีที่แล้ว

      You’re most welcome Mehedi 😊

  • @moviestv9591
    @moviestv9591 ปีที่แล้ว

    hahsdhahah good

  • @vacilando86
    @vacilando86 ปีที่แล้ว

    How great explanation it is !