Power BI DAX: Running Totals Using Variables, CALCULATE, and FILTER

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

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

  • @28goldenboy
    @28goldenboy Год назад +9

    This was by far the best, easiest, and most concise explanation for running totals on PowerBI! Thanks a lot for putting this together.

  • @sabarashid1513
    @sabarashid1513 7 месяцев назад +2

    You are a life saver! I was searching exactly for this - running total for date and category together. Everywhere I searched, it was either only by date or category. Thanks alot!

  • @nampai
    @nampai 3 года назад +6

    It took me an eternity to find this solution online. Thank you so much!

    • @PragmaticWorks
      @PragmaticWorks  3 года назад

      You are welcome! Glad we could help provide a solution for you!

  • @Mj27th
    @Mj27th 8 месяцев назад +1

    Probably the greatest video I've ever seen explaining a DAX formula for Power BI. You have a new subscriber from me. I will be watching all these videos

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

    It took me only 5 hours to find this video, verry helpfull since i need to have multiple running totals for diffrent suppliers.

  • @xalladus
    @xalladus 2 года назад +10

    I watched way too many videos on this, and this was the first one that actually made sense to me. Even though it wasn't the exact solution I needed, the way it was explained made it easy to adapt to my project. Thank you so much! I only found out about power BI 3 days ago, I am so behind.

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

      You're welcome! Thank you for your comment (:

  • @patricktemple2724
    @patricktemple2724 2 года назад +3

    Great video, spent ages watching other videos and reading through online guides but this one sorted my issue straight away!

  • @AjayAntony-m9r
    @AjayAntony-m9r Год назад

    By Far The Best Explanation so far

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

    I have been trying to do this for days!!!! Thank you so much! I actually finally understand how filtered tables work.
    Just amazing!

  • @walterstevens8676
    @walterstevens8676 10 дней назад

    This was very useful, thanks. I'm trying to dsplay, for a range of dates, all rows that have a certain date below a certain date and another date greater than another. You've given me some ideas.

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

    thank you thank you thank you!!!! I've been racking my brain on making a perpetual inventory column and you solved my problem!!!! you now how a loyal new subscriber.

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

    I watched and learned easily from Your Video. Thank you first of all. Yes you are the best teacher and know how to present , Explain and transfer it to the mind of the listener. I really appreciate this.Excellent

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

    I was searching for a proper way of calculate func with dynamic filters.
    Video helped me a lot.
    thank you

  • @Agxo1
    @Agxo1 2 года назад +3

    Wow this was amazing. I spent days trying to figure this out. Thanks!!

  • @frezerzelalem4017
    @frezerzelalem4017 4 месяца назад

    This is great solution.Thanks! I tried to recreate as exactly what you did with VARIABLES and it worked. But tried without the variables and it didn't work correctly, instead returned the total sum of all values (72). Not sure why

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

    Thank you. Great video. Clear explanations. I worked out the example with jumbled up Agency rows and ended up with the correct answer.

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

    Thank you Sir. Along with the way you have shown here, I made a little modification to get a S curve which is restricting a cumulative value upto a certain date. This video is a super help.

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

    Sir, you have just saved a couple of days of my life. Thank you for your tutorial.

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

    Thanks for this great explanation! That filter even works on the grand total below!

  • @fromtonghua5018
    @fromtonghua5018 9 месяцев назад

    Excellent tutorial. Explained step by step.

  • @jayatushar
    @jayatushar 3 месяца назад

    Nice...hlelped me. However a question -- do we have to have the records sorted in ascending order of the date? or does system/Dax take care of this?

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

    Well done, well said, the pace is excellent, the explanations are clear and you are appreciated! Looking forward to the next one!

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

    You have saved my life, totally clear. TY

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

    Thank you! I was really trying to find something that wasn't a measure in this specific project that I'm working on.

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

    Thank you so much! This has been puzzling me for days!

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

    Exactly what I was looking for. Thanx! Plus it’s clear and simply put!

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

      So glad you liked the video Jerome, thank you for learning with us!

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

    Awesome explanation! Easy and direct to the problem.

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

    😎Your didatic is very clear, it´s rarely in youtube, thanks for share your knowledge!!!

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

    Not sure whether you can introduce if we want to create the measure instead of adding the column. I tried to add the columns it works, but it doesn't work if I want to create the measure. Would you help to introduce that? Thanks! But really appreciate that video.

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

    i don't write a lot of comments in RUclips, but thank you very much :) I still don't know what I'm doing but it works

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

    This is a really useful tutorial - thanks for posting it!

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

    Thanks for your solution and it worked in my problem well. However, when I tried to slice the data using a slicer, the DAX does not take the sliced data into account. The DAX calculation still ignores the slicer. For example, if you create a slicer on Sales[Date] in your example, when you slice it, the DAX calculation will not change in accordance to the slicer.

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

    Thank you very much for the explanation. Very well explaned and very helpful :)

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

    Why does the running total get summarized when used in a chart? My similar sample data looks as expected in a table visualization or in the data view, but in a chart context the new column gets summarized without an option to not do so.

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

    It was the exact same solution that I was looking for days. Thank you so much. Now the question is how can you show that in clustered and line chart? Thanks

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

    This is cool! but what if i need the running total value showing up at certain dates (month End). How would I do that?

  • @lucianmuntean5534
    @lucianmuntean5534 3 года назад +1

    What if you have for the same Agency 2 rows with the same date but diffrent sales no. then the summ won't work for the columns with the same date

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

    Hi, I found your Channel really helpful, you can explain complicated things quite easy to understand. Do you happen to have a video explaining cardinalities in iterator and relationship? Thank you very much!

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

    Excellent video. Great explaining and showing of the programming! Just suscribed to the channel!

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

    thank you so much for the help. blessed you sir

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

    Thank you for the video, it was really helpful! Just another question, is there a way to filter the table, so it just shows the last row for each branch, without it messing out with the calculation?

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

    Thank you so much. My case has a problem that the same Agency had more than 1 transaction on the same day. Ex: 1/1/2021 Agency A transacted 2 times. As a result, the running total of 2 transactions is equal. Hope you give me a solution.

  • @NiharB-f1x
    @NiharB-f1x 8 месяцев назад

    When I try to create a new column by following your process, it’s not letting me reference another column while defining the variable. Just shows a list of all existing measure.
    Please help because creating a custom column is not fun.

  • @Matteinko
    @Matteinko 3 года назад +4

    Oddly this is one of those videos online that, if learnt by heart, can land you a GOOD JOB and at this date it has ~650 visualizations 😂😁

    • @MrThapaliya233
      @MrThapaliya233 3 года назад +1

      Agree!

    • @lakeshed
      @lakeshed 3 года назад +1

      Totally agree

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

      You think this example is that highly sought after? Interesting

  • @rubenaugustine8666
    @rubenaugustine8666 7 месяцев назад +1

    Thanks, Matt

  • @philipstern2929
    @philipstern2929 3 года назад +1

    This video has helped me a lot! Could you tell me if there is any solution to make the running totals filter by year in a new column? I want to make my Running Totals start from 0 when a new year starts but I find no way to make that work in a new column. Thanks a lot!

    • @TheAlgebraTeacherPOWERStoBI
      @TheAlgebraTeacherPOWERStoBI 3 года назад +2

      Hi Philip. I'm guessing you would want to use the time intelligence DAX function TOTALYTD to accomplish that scenario.

  • @walterstevens8676
    @walterstevens8676 10 дней назад

    What I'm confused about here is probably just a matter of syntax. It appears as if you assign a Date (Sales[Date]) to a variable (CurrentDate), and then later compare that variable back to an identically named Date.

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

    Exactly what I was looking for. Tx

  • @CrymesThe
    @CrymesThe 2 месяца назад

    does not allow you to write var currentdate = 'datetable'[date] without a context for the column, same with the "agency" case, think this video might be dated?

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

    Thank you so much,Please Keep Going.

  • @MrThapaliya233
    @MrThapaliya233 3 года назад +1

    Very well explained, thank you!

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

    Why don't we use the formula "Rolling sales total = calculate(sum(Sales_table[sales]), Date_table[Date_column]

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

    It was very helpful, thanks a lot!

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

    Really interesting approach, and one to add to my list of 'how to', do you think it has any advantage over just ( and I do mean for a column, never a measure ), using 'EARLIER' and just decaling a VAR for 'agency' or my own favorite, in the case of above;
    CALCULATE, SUM(Sales[Sales] ,
    FILTER(ALLEXCPT(SALES, SALES[AGENCY] ),
    SALES [DATE] < = EARLIER ( SALES[DATE]) ) )
    Which does away with declaring agency as a variable and using && to join to earlier.
    I am in power pivot more than bi.

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

    Shouldn't the Rolling Total column sum to 72? Since we are using a rolling total for each agency, it would be 38 + 34 = 72. Isn't this the correct answer?

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

    🎉 you’re best!!! Thank you so much!

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

    I want to do running totals by membership and loop for 12 months from the start date buy goods. How do this? Please help me.

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

    Thanks for the video!!!!

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

    How we can separate the agency "A" & Agency "B" in two columns instead of all value is in one running total column ??

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

    That's exactly what I'm looking for! Just one tiny thing... Is there any way to transform this formula to use it in a DirectQuery example? That would be awesome, thank you!

    • @510z2
      @510z2 Год назад

      If you are using Direct Query then you can create the column with SQL code using window functions

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

    Great content as usual. But I think this process is very memory intensive.

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

    Great video

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

    Thank you.

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

    What happens if sales jumps from Nov to Jan, no dec information?

  • @ranbirwadhawan6327
    @ranbirwadhawan6327 21 день назад

    how to keep rolling for 12 periods from selection?

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

    Great thank you!!

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

    Great video!

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

    Do you have a next video where you return the Date when reached certain running total amount? Or let me ask it as a more general question - how to calculate a median value of a dataset that is aggregated, meaning has frequencies - 10 times value X, 2 times value Y presented in 2 rows in a table, instead of 12 rows. Therefore, Median formula is not helpful. Thank you!

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

    Hi please help me, how to calculate running total exclude current month

  • @dianajimenez9574
    @dianajimenez9574 11 месяцев назад

    I get an error message that says, "a circular dependency was detected: EqAuditsReq[Column].
    This is my code:
    Column = var CurrentMonth = EqAuditsReqRT[Month Number]
    var CurrentBranch = EqAuditsReqRT[Branch]
    var FilteredTable = FILTER(EqAuditsReqRT, EqAuditsReqRT[Month Number] = CurrentMonth && EqAuditsReqRT[Branch] = CurrentBranch)
    return CALCULATE(sum(EqAuditsReqRT[Equipment Audit Requirement]), FilteredTable)
    Can anyone help?

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

    thanks

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

    What about running totals for items per dc per Region per week and per snapshot date? Whew that’s a lot to explain

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

    So many formulas just for a simple row sum total? Easier in excel

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

    This will give wrong results fir repeated dates fir sam agency !!!

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

      Wouldn’t you sum the sales by grouping agency and date first?

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

    Total is not correct