Forum Discussion

mrs13's avatar
mrs13
New Member
8 years ago

Running total: Column vs Measure

Hello, all

 

I have the following problem: from a database that contains a date column; country column; city column and an event name column, I want to display a line chart that accounts for the accumulated number of events through time in each location.

 

This sounds rather easy, and solvable by applyng a Running Total measure. The question is, if I do that, I am not able to display the values in between dates. So if there was a Marathon in New York in March and another in May, my graph will display the Running Total as 1 for March, there will be no data point in April (although visually it will look like a 1.5) and 2 for May. This becomes a problem when I try to also display the share of Marathons that cumulatvely took place in each city in April.

 

The other option I tried to implement was the Running Total column, which would eliminate the missing date issue by creating data points for every date, containing the cumulative value. However, this means sacrificing my ability to filter the data, let's say, by country, beacause the calculated column is statical and is not recalculated once I select a subset of my data.

 

I understand describing the problem without the sample or screen capptures is very subjective, but I have been stuck with this for the past few days, and any ideas would be greatly appreciated.

 

Thanks in advance.

2 Replies

  • Phil_Seamark's avatar
    Phil_Seamark
    Microsoft Employee

    Hi mrs13

     

    Definitely stick with the calculated measure approach, so you can keep it dynamic.

     

    Can you please share the code you are using for your calculated measure?

    • mrs13's avatar
      mrs13
      New Member

      Hello, Phil

      Thanks for your answer. I am using the following code:

      Running Total =
      CALCULATE(
      COUNTA('Database'[Events]);
      FILTER(
      ALL('Database'[Date]);
      ISONORAFTER('Database'[Date]; MIN('Database'[Date]); DESC)
      )
      )