Running Total in Power BI (for Date and Non Date Values)

Sdílet
Vložit
  • čas přidán 31. 07. 2024
  • Let's dive in Running Totals for Date and Non Date Values.
    - - - - My Courses - - - -
    ✔️ Mastering DAX in Power BI -
    goodly.co.in/learn-dax-powerbi/
    ✔️ Power Query Course-
    goodly.co.in/learn-power-query/
    ✔️ Master Excel Step by Step-
    goodly.co.in/learn-excel/
    ✔️ Business Intelligence Dashboards-
    goodly.co.in/learn-excel-dash...
    - - - - Blog - - - -
    www.goodly.co.in/blog
    - - - - Download File - - - -
    www.goodly.co.in/running-tota...
  • Věda a technologie

Komentáře • 115

  • @pupycron4302
    @pupycron4302 Před 2 lety +1

    this is great and you made it so simple. I was in for the non date version. 4 minutes and I get it!

  • @stevencampbell3203
    @stevencampbell3203 Před 3 lety +6

    Thanks, exactly what I needed, cumulative sum not dependent on dates! I also like the fact that you don't waste any time in your presentation

  • @michaelpacia7356
    @michaelpacia7356 Před 2 lety

    Straight to the point presentation! You did a great job Bro!

  • @dapperlink
    @dapperlink Před 2 lety

    I just beat my head against the wall trying all others solutions using the IF with ALLSELECTED and BLANK to stop cumulating on blank rows. I try your simple IF statement and BAM! Worked!

  • @kummithavenkatareddy2302
    @kummithavenkatareddy2302 Před 2 lety +1

    Honestly, its amazing the way you are explaining like the Execution of DAX in Complex queries. I liked it. Suggest best books for that

  • @MarkBrady
    @MarkBrady Před 5 měsíci

    Thanks for all of your videos. You really fit with my learning style.

  • @madhusudhanreddyt2838
    @madhusudhanreddyt2838 Před 3 lety

    Awesome!!!!! Thanks for sharing this video...specially running total against product

  • @mlkabir12
    @mlkabir12 Před rokem

    Precise, concise yet thorough. Like it !!!

  • @abinandan_a
    @abinandan_a Před 3 lety

    Thanks man !! Second half was tricky, couldn't find elsewhere.

  • @hk_200k
    @hk_200k Před 3 měsíci

    did we have running total quick measures 3 years ago? This one is fab and now I finally
    understand the logic behind.

  • @mahithamylo66
    @mahithamylo66 Před 4 měsíci

    Awesome explanation, really understandable

  • @kumargaurav5644
    @kumargaurav5644 Před 2 lety +2

    Great Video. I tried to find the logic for calculating the same but did not get the results. Thanks to you for creating this video and answering my query. I actually find another way to do so. Using SELECTEDVALUE:
    CALCULATE(
    [Total Sales],
    [Product Column]

  • @alpesh417rt
    @alpesh417rt Před 3 lety

    Super cool - implemented

  • @gmfer9604
    @gmfer9604 Před 3 lety

    Dude, this was great and perfectly explained.

  • @williamarthur4801
    @williamarthur4801 Před 2 lety

    One thing, thank you for showing the if ( total sale Blank(), I'd been trying to use
    " " as you would in excel and ending up with nothing at all, it's one of those DAX functions that makes sense along with M's 'then ' and 'else' , but is a bit of a hindrance when you've been used to how excel works for decades.

  • @alkarimsamnani963
    @alkarimsamnani963 Před rokem

    Wow, this one worked like a charm. Thank you so much!

  • @krupalpatel8990
    @krupalpatel8990 Před 10 měsíci

    Thank you , great help

  • @nasrilila7286
    @nasrilila7286 Před 3 lety

    Thank you very much realy useful

  • @b0rme
    @b0rme Před 2 lety

    I could comment this on every one of your videos but thank you so much

  • @snaglekar
    @snaglekar Před 3 lety

    Hey 👋,
    Loved the explanation with using ranks.
    I wanted to use non-date variables but I would still like the visual to be depending date-wise. But when I do that then running total column doen not come correct. Can you please guide.

  • @hunterslattery6668
    @hunterslattery6668 Před 2 lety

    Thanks much appreciated

  • @isidrebague3659
    @isidrebague3659 Před 3 lety

    Excellent explanation Chandeep. Thanks for sharing.

  • @benjaminanic7899
    @benjaminanic7899 Před rokem

    Hi there - great video, thank you for the content. I have a question, I have an initial contract budget value column (one record) in one table and a column with many contract change orders in another table. How can I create a running total that starts with that initial contract budget value column and the running total is based on contract change orders. Let me know if you can help! Thanks in advance

  • @hitendradagra717
    @hitendradagra717 Před rokem

    Thanks Chandeep for the Solution,
    It really helped me in resolving my requirement.

  • @marvinalavi7620
    @marvinalavi7620 Před 2 lety

    thanks a lot, very well explained!

  • @cesarsaldana3429
    @cesarsaldana3429 Před 2 lety +1

    Hi Goodly, what happens when you have several sellers with the same sale, you have to have a tiebreaker criterion because if you don't, the rank formula fails.

  • @yzhu2230
    @yzhu2230 Před 3 lety

    Great video, thanks, question from me. I've got my 3 months rolling average calculation which I can show as matrix (table), However, I'd like to show only the last 3 months rolling average as a scorecard, is it possible? Thanks

  • @sandeepreddy7687
    @sandeepreddy7687 Před 3 lety

    Thanks Chandeep. Much useful of text type running total.

  • @sukhomoyb
    @sukhomoyb Před 3 lety

    Hi Chandeep,
    Great tips dear. We would be grateful if you please show us a tricks on periodic average. In detail, say for an example. I need to create a measure to asses our sales; on current or selected months sales vs prior 3 months average sales; current or selected weeks sales vs prior 4 weeks average sales; or Today or selected days sales vs prior weeks average(last 7 days) sales. I am not expecting a single measure can give all the above answers but the way or a snippet to get answers for each above case.
    Hope all your followers would be benefited with this tricks.
    Thanks in advance. Sukhomoy

  • @shifaali1923
    @shifaali1923 Před 3 lety

    @Goodly Hi, one quick question please?
    How come the grand totals of total sales and the cumulative sales doesn't match?
    I thought the grand should match?

  • @jeramzPC
    @jeramzPC Před 2 lety

    I've been looking for the solution to remove the months that don't have value. Didn't realize it had to have that IF statement. Thank you so much!!!

  • @StephenBrincat
    @StephenBrincat Před rokem

    Hi Goodly, and what about running total for same period last year without any date slicers?

  • @kumarprabhu
    @kumarprabhu Před 2 lety

    Thank you!...What if i dont want a running total instead I want to repeat the last row value of a previous column entirely for the next column?...if 1000 is the last value found in a measure result of a previous column, i want to show 1000 for all rows in the next column using measure..please advice

  • @rushikeshgadakh6435
    @rushikeshgadakh6435 Před 2 lety

    wonderful explainations and so simple

  • @AhmedShabeer
    @AhmedShabeer Před 3 lety

    Great video. When I tried to find RT in a model with a date table, I get several infinity values. How to solve this, please?

  • @shoaibrehman9988
    @shoaibrehman9988 Před 2 lety

    Hi Chandeep, your way of teaching is gr8 relate to this topis i am unable to resolve the issue when you performing a running total by category and then by months.
    Means Products A,B and C orders running total in month of Jan , feb ... etc.
    Could you pls explain in next videos.
    Thanks in advance

  • @patrickkinbonso1809
    @patrickkinbonso1809 Před 9 měsíci

    Amazing.
    How about the running total refresh anew on each different product?

  • @OneHourOnlyPodcast
    @OneHourOnlyPodcast Před 3 lety

    Hello I'm trying to calculate a running total for each month starting from (April to March) but the sale value is separated into three separate sections each with their own value that also need a running total so at the end we end up with a total with three individual sections
    Month Status Amount
    April Recipted 10
    April Submitted 10
    May Accepted 10
    May Receipted 15 (10 from april+ 5)
    each month will be totaled into a column but is a clustered column with each status
    with my visualizations being able to see a total and individuals of each status, hope you can help

  • @jhaanand81
    @jhaanand81 Před 2 lety

    Hi Chandeep i have one question how can you exclude blank column while calculating running total in power query

  • @juansierra55
    @juansierra55 Před 10 měsíci

    Could you show how to make a Pívot Table running total by columns ( week numbers) instead by row dates (standar function in pt). Using power qty or power pívot

  • @deepakaggarwal8624
    @deepakaggarwal8624 Před 3 lety +1

    what to do if there is a tie in value, in this case we would get the same rank...what to do in this case?

  • @makali2710
    @makali2710 Před 2 lety

    i want to add the Date slicer in date in video if i select from 01-01-2020 and 31-12-2020 it should sum the old and and show the now running balance it is possible please reply ?

  • @ardenzhuo9351
    @ardenzhuo9351 Před 2 lety

    The second time you did the rankx, where PdtRank >= Rankx…
    How is that different from the variable defined in previous step?
    Can we use PdtRank >= PdtRank?

  • @geethareddy528
    @geethareddy528 Před 11 měsíci

    Hi brother great to see this video

    • @geethareddy528
      @geethareddy528 Před 11 měsíci

      Can you explain this to days cumulative, for example if July month reach the end date the we have add that end date value to next month dates (July 31 value +Aug 01+Sep +01) and if next month reachs to end the (July 31+Aug 31+sep 01)

  • @durgeshshukla6291
    @durgeshshukla6291 Před rokem

    ty sir, you help me alot

  • @raghunandanmsmsr3492
    @raghunandanmsmsr3492 Před rokem

    Hi, Is there way we calculate the running total with same condition but show the results only after few months. Say, if my bias is 3 month values in running total should start appearing after 3 months.

  • @williamarthur4801
    @williamarthur4801 Před 6 měsíci

    One question I have is why; if you create the rank as a measure rather than a Variable do
    you get the grand total back?

  • @herrsan
    @herrsan Před 2 lety

    I cannot get your solution to work on my example. Even though all rows are filled, it says
    A single value for column ‘Gross Margin’ in table ‘Sales’ cannot be determined. This can happen when a measure formula refers to a column that contains many values without specifying an aggregation such as min, max, count, or sum to get a single result.
    As I said each row in column 'Gross Margin' is filled with a value (same with 'Product Name').
    Why is that??

  • @jagadeeshkumar485
    @jagadeeshkumar485 Před rokem

    Hi, I have a question how can we calculate running total based on Month Name and the month name should be shown in the visual as calendar order like JAN, FEB, MAR, etc.

  • @shifaali1923
    @shifaali1923 Před 3 lety

    This is really helpful Video, I really enjoyed the content !
    The solution worked for me but I am still not able to understand , what was wrong in my DASX which I was trying earlier? I was trying the same thing but instead of creating variables I created first rank in my product table and then created CumSales measure in my sales table like below -
    1. First create a rank for C. Parent Account like
    ranking = RANKX(All('CAccount'[Parent Account]),[Total Sales],,DESC)
    2. Then create the cumulative measure
    CumSales =
    CALCULATE([Total Sales],FILTER(ALLSELECTED('C Account'),'C Account'[ranking]

  • @arnav2399
    @arnav2399 Před 3 lety

    Great way of teaching, if you can record video in hindi , so more people will follow you

  • @viveks4
    @viveks4 Před 6 měsíci

    Hello chandeep, I have a question here,
    You used max for calendar date but you didn't use it for Rankx function. Could you please clear this point.

  • @damienlomath1766
    @damienlomath1766 Před 6 měsíci

    Good video , how about you have so many slicers, like Regions , Districts, and Dates, How will u go about it such that as the slicers change the running total will also change

  • @truptidahiphale7586
    @truptidahiphale7586 Před rokem

    Hey....can you explain the function ISONORAFTER?

  • @williamarthur4801
    @williamarthur4801 Před rokem

    One problem, is that if you have a tie , they are aggregated andt then added, I had the same problem when using the sorted sales smallest to largest as the citerial;
    RTM by Sales:=VAR onev =
    IF(HASONEVALUE(Table1[Sales]),VALUES(Table1[Sales]))
    VAR anser1 =
    CALCULATE([Tsales], FILTER(ALL(Table1) ,Table1[Sales]

  • @boracayrum
    @boracayrum Před 2 lety

    Please teach us how to do running total in nested table in power query.

  • @kummithavenkatareddy2302

    We have 2 columns:- Customers and their Profit/Loss.
    Percentage of contribution by no of customers to whole profit.
    Pls do video on Pareto Curve

  • @surender665
    @surender665 Před 2 lety

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

  • @sebastienschoonjans9727

    Is it possible to create a running total in a summarised table?

  • @mohammadfarooqhaider4661

    Hello, can u help me out in my below query.
    I have 3 tables;
    1) Mutual Fund table which has fund name and other details.
    2) Customer table which has customer details
    3) Customer balance table date wise
    Table 1 n 2 have active relationship with customer balance table.
    But when I place one Table-visual to show customer name wise balance it’s duplicates some records (means if customer balance is 100 but it show 200). I am getting customer name from customer table while balance from balance table and they both have relationship with a field as customer account number which is unique in customer table. Can you help me out how to fix this. Thanks

  • @3danim8r1
    @3danim8r1 Před 3 lety

    Thanks Chandeep!
    If we need to calculate Running total separately for a year. For example if 2011 year end then restart running total for 2012 separately. I don't want to include 2011 data in 2012 running total.
    Similarly can we calculate running total separately for a products as well?

    • @GoodlyChandeep
      @GoodlyChandeep  Před 3 lety +1

      1. The running total for a year means YTD.. that can be solved using TOTALYTD function
      2. The current running total for products measure will work in case you want to do a product running total by year. Just place the year in the matrix

  • @hifii9718
    @hifii9718 Před 2 lety

    How can we compare current rank value with all other rank values without using variable? Pls help me with this one I'm stuck here

  • @williamarthur4801
    @williamarthur4801 Před 2 lety

    I've just noticed that your running total does not re calculate at the end of the year?
    I've been trying to achieve this but (for months , not years) but I always end up with it starting again at the end of each group?
    RTM:=VAR mdate = MAX(Table2[Date])
    VAR anser =
    CALCULATE([tSales],FILTER(ALL(Table2[Date]),Table2[Date]

  • @miosotisazul4571
    @miosotisazul4571 Před 2 lety +4

    Hi. great explanation! Is it possible to show this last running total for non date field in percentage? So that the last row will equal 100%.

  • @saikoundinya9913
    @saikoundinya9913 Před 9 měsíci

    for some reason, I got rank as 1 for all the rows. Rechecked my formula multiple times. Is there something else that needs to be done

  • @landrymel6593
    @landrymel6593 Před rokem

    It doesn't work on my side, I don't know why? Still getting the same amount of sales per month (no YTD/running amount). Any suggestion for me please?

  • @InderjeetSingh-qi5td
    @InderjeetSingh-qi5td Před 3 lety +2

    Thank you Chandeep for the explanation. Very useful, however, one query, what if the Total Sales are same for 2 products? Does it provide correct total?

    • @storiesfromincredibleindia
      @storiesfromincredibleindia Před 2 lety

      Yes, it does because he has used "Dense" Rank which gives same rank on tie. and so both the numbers with same value will have same rank and you will get correct results.. I hope it helps.

  • @corentincorcelette3598

    Good job but i have a problem : dax query is really really slow (136617 ms) with 200 000 product (14 000 distinct)

  • @aniketraut6864
    @aniketraut6864 Před rokem

    Hi Goodly, thank you for this useful video, but I have multiple columns in place in the table visual hence the table keeps loading forever.

  • @reubenfernandes3242
    @reubenfernandes3242 Před 3 lety

    Hi Chandeep, thank you for your very helpful videos. I have used this method to write a measure for running total calculation which is working. However in months where there are no total sales during the sales period, blank values are returned (as per the IF result), ideally the running total of the previous months should be carried over in such cases.
    I've been trying a lot to find a work around for this but i'm not having much luck. It would be great if you can offer some advise.
    Thanks

    • @GoodlyChandeep
      @GoodlyChandeep  Před 3 lety

      You can remove the IF that checks for Sales value.
      It should give you the running total for all months with or without sales

    • @reubenfernandes3242
      @reubenfernandes3242 Před 3 lety

      @@GoodlyChandeep correct, but then the running totals will be calculated for the entire calendar duration which is not acceptable either.

  • @sabrinalimage166
    @sabrinalimage166 Před 3 lety

    Great video Chandeep!!!
    Question for you. I am trying to calculate a running total, but my visual has a date filter. I am using the relative date filter to show data for the last 6 months from today. I can't seem to figure out 1. how to make the calculation work without having to manually select dates and 2. if there is no data in the earliest date, give me the EOM total and continue with the running total.
    Any suggestions?

    • @GoodlyChandeep
      @GoodlyChandeep  Před 3 lety +2

      Sabrina, Do you mind sharing some sample data with me? It'll be far easier to solve the problem that way.
      goodly.wordpress@gmail.com

    • @sabrinalimage166
      @sabrinalimage166 Před 3 lety

      @@GoodlyChandeep Thank you! message sent!

  • @ranaahmadsattar
    @ranaahmadsattar Před 2 lety

    Great vidoe. I just have one question!
    How to get running total to a specific date. For instance if we have a cut off date or data date in our report and we don't want to go beyond. How can we restrict our measure for this. Thanks in Advance!

    • @GoodlyChandeep
      @GoodlyChandeep  Před 2 lety +1

      TOTALYTD function has a custom date year ending input

  • @sajjadsmeinbox
    @sajjadsmeinbox Před 3 lety

    What is the course fee for Indian students to enroll the bundle course.

  • @bshlplcf-rt8oy
    @bshlplcf-rt8oy Před rokem

    No comparison for respected sir

  • @contabilidad_del_futuro
    @contabilidad_del_futuro Před 10 měsíci

    Hi, great video. Could you do another measurte with the same table with running total but adding date column?. I mean column date, product, total sale and finally running total

    • @sandeepsandy5286
      @sandeepsandy5286 Před 9 měsíci

      Running_totals =
      SUMX(
      WINDOW(
      1,ABS,
      0,REL,
      SUMMARIZE(
      CROSSJOIN(ALLSELECTED(Cal),ALLSELECTED(Products[Product])),
      //Cal[Date],
      Cal[YEAR],
      Cal[month]
      ,Cal[index],
      Products[Product]
      ),
      ORDERBY(Cal[YEAR],ASC,Cal[index],ASC,Cal[month],ASC)
      ),
      [Total_sales]
      )

  • @sunilchoudhary6007
    @sunilchoudhary6007 Před 2 lety

    But Sir amount will same 2 product or more then 2 then
    given problem, pls shot out this

  • @RakeshSaha1705
    @RakeshSaha1705 Před 11 měsíci

    what is the measure behind total sales

  • @namangarg7875
    @namangarg7875 Před 2 lety

    Suppose my product has numeric values starting from 1 to 1000 and also has duplicate values in the sales table and i want to rank the product based on the maximum revenue... How to do that??
    I have applied Rankx(all(sales table[product id]), [total revenue],, Desc, dense)
    My answer is coming wrong. Please help

  • @jhaanand81
    @jhaanand81 Před 2 lety

    Sorry i meant blank row while calculating running total in power query

  • @eladiobardelli3001
    @eladiobardelli3001 Před rokem

    Acumulado =
    var serie = max (tabla1 [N] )
    var resumen = filter ( allselected ( tabla1) , tabla1 [N] < = serie )
    return
    sumx ( resumen , [campo montos] )

  • @geethareddy528
    @geethareddy528 Před 11 měsíci

    How to join to your membership ship

  • @snoomtreb
    @snoomtreb Před 10 měsíci

    I could kiss you, been looking for this for hours xD

    • @GoodlyChandeep
      @GoodlyChandeep  Před 10 měsíci +1

      Can accept a virtual one. Equally happy if you subscribe too 😛

  • @vimukthiamarasena6264
    @vimukthiamarasena6264 Před 3 lety

    Hi can you give me a hint to calculate the Running total with duplicate dates. (example: when there are many orders per one day)
    Date Order Order Qty running Total
    11/17/2020 A 5 5
    11/17/2020 B 10 15
    11/17/2020 C 4 19

    • @GoodlyChandeep
      @GoodlyChandeep  Před 3 lety +1

      Are you trying to calculate running total (across all years of data) or a YTD / MTD?

    • @vimukthiamarasena6264
      @vimukthiamarasena6264 Před 3 lety

      @@GoodlyChandeep thanks for the Quick reply... what I'm trying to do is an inventory shortage model. please see the below fig. here ( balance= inventory - Running Total )by Raw wise
      my plan is to subtract Running total from inventory to get balance(FIFO System).
      my limit is I can't calculate Running total within a day. it gives 19 for all records which date is 11/17/2020 instead of giving a breakup as below
      Order Date Order No Order Qty Running otal inventory Balance
      11/17/2020 A 5 5 15 10
      11/17/2020 B 10 15 15 0 11/17/2020 C 4 19 15 -4

  • @surfman88
    @surfman88 Před 3 lety

    Crazy this is not in power bi standard. It is built in excel for use with pivot tables.

  • @Wzxxx
    @Wzxxx Před rokem

    I don’t understand this. First the ALL function removes all filters from date. So why max date is not a real max date from all dates but it is still using date from table row as a filter context.