Create a Running Total by Category in Power Query

แชร์
ฝัง
  • เผยแพร่เมื่อ 30 มิ.ย. 2024
  • Want a running total that resets for different categories? This video shows how you can create grouped running totals.
    WRITTEN ARTICLE
    gorilla.bi/power-query/runnin...
    Master Functions and Syntax in M
    powerquery.how
    CONTENTS
    00:00 Introduction
    00:44 Running Total List.Generate
    01:40 Create Running Total Function
    06:36 Apply Running Total Function
    08:26 Running Total by Group
    ABOUT BI Gorilla:
    BI Gorilla shares videos and articles on Power BI and Excel to help you improve your skills.
    Website: gorilla.bi
    SUBSCRIBE TO MY CHANNEL
    th-cam.com/users/bigorilla?sub_con...
    LET'S CONNECT:
    Blog: gorilla.bi
    Facebook: / bigorilla
    Twitter: / rickmaurinus
    LinkedIn: / rickmaurinus
    Thank you for your support!
    #RunningTotal #powerquery #bigorilla

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

  • @BIGorilla
    @BIGorilla  ปีที่แล้ว +6

    Want to read the written article? You can find it here: gorilla.bi/power-query/running-total-by-category/
    And in case you need to brush up how Running Totals work, the foundations you can find here: gorilla.bi/power-query/running-total/
    Enjoy Power Query!

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

      Merci beaucoup!

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

      Thanks, I've tried combining a group function with the running total, not much success ; So put say;
      (Gfunc)=> let
      Grouping = Table.Group(Gfunc {"Item"}, {{"Count", each _ }} )
      in Gfunc
      With a Running total function so all in one hit, the probem child is the grouped All Rows. my fav rtc is ;
      List.Skip(
      List.Accumulate( Source, {0}, (s,c)=> s & {List.Last(s) + c} ),1) , don't know how this compares with generate?

  • @check537
    @check537 ปีที่แล้ว +2

    This is SO complicated for such a simple calculation. Not criticizing the teaching here, which is very clear and helpful. Rather, I don't get why Microsoft doesn't just have a button for "calculate running total by group".

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

      You’re right Mike. You can also take any of the methods in this article:
      gorilla.bi/power-query/running-total/
      The first two are muchhhhhhh easier. However, they’re also slow 🥁 hence I’m teaching this one

  • @DeronHuskey
    @DeronHuskey ปีที่แล้ว +3

    I started today with your post on List.Generate which led me to your running totals videos.
    3 hours later and at least 30 clicks of the pause button and another 10 or so rewinds, I'm done.
    All three videos were great.
    Watching the evolution of running totals from List.FirstN to the function used to group by category really helped it sink in.
    Thanks

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

      Wow, that's amazing! I'm so glad you found my videos helpful and that you took the time to really dive into them. It sounds like you've been having a lot of fun learning, and I'm glad I could be a part of that. And thanks for watching my videos and giving me a feedback! 😁😁

  • @Traderzen1617
    @Traderzen1617 10 หลายเดือนก่อน +1

    Your pedagogic skills, the content, and the structure of these videos - everything is so well thought! Thank you!!

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

    Again a great and clear explanation of a topic I was looking for. I'll have to watch this video a few more times before I understand the building of a function. But it's definitely worth it. Thank you.

  • @sambaker81
    @sambaker81 10 วันที่ผ่านมา

    Dude, you saved my life 😂 awesome video
    I also really like that you gave the m-code of your previous video as a summary to start this video - saved me a lot of time so I didnt have to watch the previous fully if I didnt want to

  • @jimgleason4040
    @jimgleason4040 2 หลายเดือนก่อน +1

    Excellent as always. I love that you always tackle the more complex problems.

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

    Really appreciate how this, and the previous video, explained the concept, step by step, to get a running total by categories. I now understand the solution and have applied it to my project. Much better than just cut and pasting a solution. The written articles was also referenced, as here the code is annotated.

  • @raitup00
    @raitup00 ปีที่แล้ว +4

    I'm seeing the steps you are applying and everything makes sense, you even make it look very easy, but for me to reach that solution, I would have to have a privileged mind like yours, to have that logic and reach the solution. And not only do you teach us the solution, you expand our minds to apply what we have learned in other problems. Greetings from Mexico!!!

    • @BIGorilla
      @BIGorilla  ปีที่แล้ว +3

      Hola Raymundo 🙌🏻
      Thank you very much for the elaborate comment. From what I can tell, you have the right attitude to pick up these techniques. And even though some of them may still be foreign, or don't come naturally, I hope you stick to it.
      You reach a level at some point where you consolidate so many different approaches. And when you reach that point you can juggle together all kinds of solutions. Truth be told this one is a bit more advanced, and it took me a bit to figure it out too. Especially keeping the data types intact.
      Just keep at it and before you know it you'll be making up these kind of solutions yourself 😁
      Enjoy!

  • @CarlHorn
    @CarlHorn 3 หลายเดือนก่อน

    That was awesome, thanks Rick! Got my work problem sorted and working, now need to sit down and fully understand this great solution.

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

    Ciao, thank you from a Power Query student, the lesson that you shared was - once again - clear and helpful. It's very difficult to express certain processes and this makes your work expecially note worthy.
    Spot on and many things!

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

      Thanks you very much Stefano. I really enjoyed creating the video and laying out the groundworks. Happy you found it valuable 🚀🚀

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

    Excellent content! It helps me a lot. With your concise explanation and examples. Thank you so much

  • @businessinsights_AlexRobe
    @businessinsights_AlexRobe 5 หลายเดือนก่อน

    Just what I needed!
    A classic topic, will for sure watch this video 4 times per year :-) , thanks!

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

    Excellent. Thanks Rick for your always excellent videos You are really a big brother in helping us understand M code. 👍👍

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

    I'm surprised with the didactic you gave us on this video!!! Fantastic!!! I used to use this same formula, but I couldn't understand the steps!!! I think I still cannot make it myself, but now I comprehend what I'm writing and expectations upon the results are clearer! Thank you so much!!!!

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

      Your message definitely made my day Marcelo. Thanks a lot. This topic isn't easy, but I'm glad the video helped!

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

    This is FANTASTIC - Thanks so much!

  • @nunobelo3137
    @nunobelo3137 8 หลายเดือนก่อน +1

    Amazing!! 5 stars!! It helped me a lot, thanks

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

    Wow I learnt a lot and just solved a major problem I currently have. Thank you.

  • @julycastiblanco
    @julycastiblanco 6 หลายเดือนก่อน

    It was amazing!!! You're an excellent teacher!!!

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

    Subscribed and Thumbs Up
    This is awesome. I like it how you explain this in a structured and easy to follow way. Voice is also clear and not boring.
    Will check the rest of your videos...

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

    Your are the BI running total genius!

  • @PradeepKumar-wh1pf
    @PradeepKumar-wh1pf 9 หลายเดือนก่อน

    You are really amazing. Thank you so much for sharing this trick, it is really saving a lot of time.

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

    Great Job. Always love on how you solve the problem. Perfect Explanation

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

      Thank you so much for the kind words! I'm glad you enjoyed my problem-solving and found the explanations to be helpful. That's exactly what I aim for in my videos, so it's great to hear that it's resonating with you. And thanks for being a fan of my videos!

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

    Great video, worth watching for the tip on using Table.Column, I'd given up on a table [Column] ,
    as variables in function, I have been using this simpler version just invoked on the Grouped Column,
    not as flexible but does work,
    (RTF)=>
    let
    Custom1 = List.Generate( ()=> [ RT = RTF [Unit] {0} , Counter = 0] ,
    each [Counter] < Table.RowCount( RTF ) ,
    each [RT = [RT] + RTF [Unit] {[Counter] + 1 }, Counter = [Counter]+1 ] ,
    each [RT] ),
    Custom2 = Table.FromColumns(
    Table.ToColumns(RTF ) & { Custom1 } , Table.ColumnNames(RTF) & {"RTC"} )
    in
    Custom2

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

    Thanks Rick, against you make my day. I have to to calculate the amount of sales for the last 3 weeks, the last 6 weeks and so on. And i will start with your solution...

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

    Thank you for the video ! It is brilliant !

  • @heathweathe
    @heathweathe 6 หลายเดือนก่อน

    Wish I could give you 5 thumbs up. This was so helpful, thank you!

  • @normalermensch5966
    @normalermensch5966 18 วันที่ผ่านมา

    This is incredible, thank you!

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

    This helps a lot, thank you! :)

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

    Thank you for the video. Very useful information and a perfect explanation 🤓

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

      Thank you! Love making these videos 😁

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

    Thank you for the great info shared.

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

    Thank you very much. This is very helpful

  • @Sandroider
    @Sandroider ปีที่แล้ว +2

    man you deliver!

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

      Thank you very much, these methods are useful for so many transformations. Hope you picked up something here!

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

    Great video, thank you! :)

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

    brilliant, will try it, TYSM!

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

    Pure genius!

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

    Really good video - thanks a lot, I learned a ton from you :)

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

      So glad to hear that, thanks Rui!

  • @RodrigoCalloni
    @RodrigoCalloni 5 หลายเดือนก่อน

    Thanks for the video... I came from Tableau word and this can be all done with a click of a mouse... I can't believe Power BI/Query requires a 17 minute video for a simple table calculation... it blows my mind

    • @BIGorilla
      @BIGorilla  5 หลายเดือนก่อน +1

      Unbelievable rightt. However, do note that you can do this much easier using the List.Range or List.FirstN function (as explained here: gorilla.bi/power-query/running-total/ )
      The method in the video, however, is preferred, with regards to performance.

    • @RodrigoCalloni
      @RodrigoCalloni 5 หลายเดือนก่อน

      @@BIGorillathanks so much for replying to me... really appreciate it. I will check the "easier" way (again I come from a world where this is really a matter of 2 clicks lol)

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

    Absolutely fantastic solution and so well explained. However I am struggling with it a bit with and 8 Million record fact table, I am currently experimenting with including a a buffered table right before the grouping - then referencing buffered table in the next two steps

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

    You're the Best!

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

    Neat and super fast RT calc.

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

    🤯🤯🤯🤯🤯🤯🤯🤯
    Great effort, you are awesome

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

    Amazing! Thanks for explaining the logic that's easy to understand.
    Like & Subscribe

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

      Thanks tx, this was a tough one, but very effective!🦉

  • @leetownsend342
    @leetownsend342 5 หลายเดือนก่อน

    Hi Rick, please can you give your advice on this. I note in the previous video, which i used the code for the start of this one you actually use the index function (can be seen in the advanced editor) rather than the count function that’s in the previous video. My data set is rather large (1.6m rows with a fair few steps before the buffered values step)and i am not getting the values i expect. Could it be that i should use index over counter and if so how can i apply. An updated version of this video would be amazing if there is now a better way. Thanks in advance.

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

    Really great video, I wanted to group the running total of last 52 weeks data, how do i achieve this?

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

    Hi, you have given a very nice explanation of running total.could you please help me in one problem that is,
    i am plotting stack chart of running count of categories with respect to date and using the same categories column as legends but in last month i don't have particular category and this running count is not carry forwarding the previous month value. so how can i do it.
    i am asking you this because this query is bit related to running sum and one loophole you mentioned in the last of one video.

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

    Do you have a video that explains how to reset running total based on a condition within sub category. For example, if the code is to be used for stock with weighted average where closing qty and closing amount (COGS of closing qty) should be displayed for the items purchased recently.

  • @28goldenboy
    @28goldenboy 6 หลายเดือนก่อน

    what are the pros and cons of doing it using dax vs what you are doing by adding a column in the query editor?

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

    In my data set, everything works great through the Grouped Rows step. After that, when looking at the running totals, it works properly for the first group, then returns "Null" for the rest of the groups, then repeats the list of groups, totals properly, nulls the rest of the groups, and repeats with no end.

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

      I suspect your Running Total does something like: Current Value + Next Value.
      When adding 'null' to any value, the result is null. So that means a running total that includes null values, will return null once it passed this value.
      You can fix this by using List.Sum( { CurrentValue, NextValue } ) instead of using CurrentValue + NextValue. The List.Sum function ignores nulls and still sums.
      More details in this article, which has a similar issue for concatenating.
      gorilla.bi/power-query/concatenate-values/

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

      @@BIGorilla After going through your videos a second time I was able to make the running totals work properly and verify the functionality with the addition of new data. Thank you!

  • @rrrraaaacccc80
    @rrrraaaacccc80 ปีที่แล้ว +2

    👍💯

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

    Hi @BIGorilla Just One question: if some of the groups don't have values for some months when you try to plot them together on a column chart the Total of different Running Totals Will be wrong, this because some of the categories have no data for some months and Power query don't sum values that don't exist. How can be fixed? Thanks

  • @chenglu1206
    @chenglu1206 3 หลายเดือนก่อน

    Thanks for nice explanation. I followedstep by step and successfully created the Running Total column with correct figures in the Power Query. However, when I close and apply, the running total is showing zero in the Power BI Report View or Table View.

    • @chenglu1206
      @chenglu1206 3 หลายเดือนก่อน

      I have found error root. I was sorting the data with wrong column, which is duplicate of month/year and then change its type to date. This new date column is not working for sorting. I re-sorted the data with year and month separately and it works

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

    Very helpful thanks. However I need to calculate rolling 12 months by category. Can you help me to do that please?

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

    Hi Rick, I‘m facing a problem right now.
    After creating the function and trying to create the new column, my current table was brought back to its beginning look, so every step that was done before (name changing, type changing etc.) has been „removed“.
    But the biggest problem I‘m facing is, that all columns, except the newly created one „running total“ have been moved down one row.
    If I now use the function „Apply first row as header“ it tales the first value of „running total“ as the new header.
    Is there a way to overcome this issue?
    Thanks!!

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

    Not sure if you are looking at your comments, but I thought I'd give some advice. You should probably go and add both Power Query and Power Bi to all your videos that you can. Some will be specific to Power Bi, but I know you have videos that can be used for PQ as well. Just a thought :)

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

      TinySparrow, Thanks for the suggestion. Some videos are indeed useful for Power Query and others for general Power BI. My title includes Power Query for this video and the tags include both Power BI and Power Query. If that's what you were suggesting, nothing to change ;-)

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

    Hi Rick, your videos have been fantastic. I tried your function at 6:09 but got this error: "we cannot convert a value of type list to type function". Any idea? With thanks.

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

      Not sure, it may be one of the references to the table parameters that's incorrect. Hard to tell without a working example.

  • @Mohamed.GadAllah
    @Mohamed.GadAllah ปีที่แล้ว

    Thanks a lot for your videos. Please, can you organize all your videos on your youtube channel into playlists so everything is organized? I like your videos a lot.

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

      Hi Mohammed. I currently have playlists for Power BI, Power Query and DAX. Have you seen those?

    • @Mohamed.GadAllah
      @Mohamed.GadAllah ปีที่แล้ว

      @@BIGorilla Thanks a lot for your valuable time replying to my comment. Do you mean it is already organized? I am sorry that my word was impolite.

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

    I rick, thanks for your video serie, i'm just seeing the best powerquery teacher (that includes you in my view) all seems to have some kind of mathematical background, is this your case..? is this required from your point of view ? Because i feel like having a base understanding of vectors and matrices is critical to understand the way list and table work under the hood

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

      Hey Anthony. Thanks, glad to see it’s helping out. I never thought of backgrounds from general pq teacher. Myself I studied accounting & business control; but this became a hobby :)

  • @KaranAnand1
    @KaranAnand1 3 หลายเดือนก่อน

    If I do a merge query(referencing another table to current) on an table after adding RT Column, then the RT column data changes to the Last RT balance of that category. Can you check?

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

    Thanks a lot for this. I'm trying to invoke a calculation for rolling 4 quarters sum by group. But I'm getting stuck. My rolling sum function won't work. Any tips?
    = (RS_Name as text, MyTable as table, RS_ColumnName as text) =>
    let
    Source = MyTable,
    Bufferedvalues = List.Buffer(Table.Column(MyTable,RS_ColumnName)),
    Custom1 = Table.AddColumn(Source, "Rolling Sum", each if [Index]>=4 then List.Sum(List.Range(Bufferedvalues,[Index]-4,4)) else null)
    in
    Custom1
    Cheers

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

    it was hard to do it but i did it

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

    Can you help me with how to calculate running total of multiple columns

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

    Hello,
    Is it possible to put measures in rows of matrix but in row will be also other variable and measures will be above this variable? Thanks in advance

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

      Hi Mariusz, I don't understand you question. This method is focused on the Power Query M Language, Measures/DAX are not involved.

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

    Hello Rick, I've tried this, but when I group the table, the sorting of the dates just disappears. I solved it by putting the Table.Sort in Table.Buffer. Hope it helps somebody.
    Other than that, great video and a great explanation.

  • @Rachel-pk1uh
    @Rachel-pk1uh ปีที่แล้ว +1

    Works perfectly in power query editor but when I try to establish the same table on a report all values from running total column disappear. Any clue how to problem solve this?

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

      That’s unusual. Please check if the steps in your query editor are in chronological order. It sounds as if your last step does not pick up the running total step

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

      @@BIGorilla Hi, I get the exact same issue while I can confirm I have performed each exact step as hte ones shown in your video. RT column with correct running total appear att the query editor level but once I click on "Close & Apply", this column becomes empty and I cannot create any chart. When I click on close and apply, I get a and error message although the query is loaded but no message (or dont know where to find) on what/where is the mistake. Any idea? I have spent a lot of time on that and still no clue. Thanks :)

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

    Hello Rick, i have a request to this fascinating Function. I tweaked it to add a column with the Max Value. I did this with a List.Max function. It does work but I need to enter manually the name of the column. Is there a way to have the name of the column in a dynamic way? Not sure I am very clear so here the code. In line 23, I’d like the (Consolidation[YtDReversed]) To be dynamic, since i already entered "YtDReversed" when i called the function, it is the name of the accumulated data i needed.. Does it make sense? I can send my file also.
    “let
    1. Source = (RT_Name as text, MyTable as table, RT_ColumnName as text ) =>
    2. let
    3. Source = MyTable,
    4. BufferedValues = List.Buffer (Table.Column ( MyTable , RT_ColumnName )),
    5. RunningTotalList = List.Generate (
    6. // Start value: Set RT to 1st value in BuffValues and set RowIndex to 0
    7. () => [ RT = BufferedValues{0}, RowIndex = 0 ],
    8. // Condition: Generate values as long as RowIndex is < than number of list items
    9. each [RowIndex] < List.Count( BufferedValues ),
    10. // Record with logic for next values:
    11. each [
    12. // Calculate running total by adding current RT value and the next value
    13. RT = List.Sum( { [RT], BufferedValues{[RowIndex] + 1} } ),
    14. // Increment the RowIndex by 1 for the next iteration
    15. RowIndex = [RowIndex] + 1
    16. ],
    17. // Only return the running total (RT) value for each row
    18. each [RT]
    19. ),
    20. Consolidation = Table.FromColumns (
    21. Table.ToColumns (Source) & { Value.ReplaceType ( RunningTotalList ,type {number} ) },
    22. Table.ColumnNames (Source) & {RT_Name} ),
    23. Add_Max = Table.AddColumn ( Consolidation, "Max", each List.Max ( Consolidation[YtDReversed]), type number)
    24. in
    25. Add_Max
    26. in
    27. Source”

  • @osamaabd-elmohsen6427
    @osamaabd-elmohsen6427 ปีที่แล้ว

    If I want to group this items based on value of running total not for category how can I do this ? I mean if i want to split this items into groups where running total for each category doesn't exceed 1000 and when it reach this limit we put the next items in another group untill they reach 1000 in running total and so on ?

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

      Interesting. What would you do once a line reaches 1000?
      Let's say your example resets when you reach 20. And you have below data.
      a 10
      b 15
      c 5
      d 5
      b would have a running total of 25. So 20, and then if it resets it gets to 5.
      So which category would b fall into? Is it the first group? Or the second? And how would you treat the 5 that exceeds the 20?

  • @Batman-hv9xw
    @Batman-hv9xw ปีที่แล้ว +1

    Is it not easier to do it with Dax with Time Intelligence function? Same results?

    • @BIGorilla
      @BIGorilla  ปีที่แล้ว +3

      Batman - Good question. Performing a running total is relatively easy in DAX. If that solves your needs, go ahead.
      There are cases where people want to perform a running total for some intermediary calculations, or perhaps they want numbers precomputed, so that when they are loaded into the data model the compression is optimal.
      Regardless of the case, there are reasons why some want to do it in #powerquery. You ought to make that judgement call. I've had a lot of people ask me how to perform running totals by group. And in those cases where you need it in Power Query, this is a good way.
      Enjoy!

    • @Batman-hv9xw
      @Batman-hv9xw ปีที่แล้ว +1

      @@BIGorilla Thanks for your answer! Keep it up, your videos are very usefull

  • @rofiemuhammad3675
    @rofiemuhammad3675 3 หลายเดือนก่อน

    i found the result when grouping by date and one category is different with the result when grouping by date and two categories

  • @satyapal9598
    @satyapal9598 11 หลายเดือนก่อน

    Hi, I am getting following error while applying function : Expression.Error: We cannot apply field access to the type Text.
    Details:
    Value=Running Total
    Key=Details Please if you can help to get this solved
    It was fine upto below step
    = Table.Group(#"Changed Type1", {"Product"}, {{"Details", each _, type table [Month=nullable date, Product=text, TQty=nullable number]}})
    Error in last step
    = Table.AddColumn(#"Grouped Rows", "Custom", each fXRunningTotalperItem("Running Total"[Details],"Amount"))

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

    Hi when is your next video coming

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

      I want to know too, not sure yet!

  • @bigbarry8343
    @bigbarry8343 5 หลายเดือนก่อน

    looks needlessly complicated. we clearly hit (severe) limitations of powerbi for data analytics.

    • @BIGorilla
      @BIGorilla  5 หลายเดือนก่อน

      Bigbarry- M is a query language. Running totals tend to be better made in DAX.
      Also, There’s plenty of easier ways to do it in M You can use List.Range or List.FirstN with List.Sum. Much easier to understand. But also performance much less.

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

    TOP!!! #powerbinareal