cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Helper III
Helper III

Running Total

Hi,

 

I have 2 years of monthly data on which I'm applying a Running Total measure as written below:

 

Running Total MEASURE =
CALCULATE (
SUM ( CompanyPortalDataBase[PageVisit] ),
FILTER (
ALL ( CompanyPortalDataBase),
'CompanyPortalDataBase'[Date] <= MAX ( 'CompanyPortalDataBase'[Date] )
)
)

 

The issue is when I'm filtering my report using a slicer on 2016 the measure works fine and it does bring 2016 running total month by month. However, when I'm selecting 2017, the measure calculates 2 years in a row which mean that January 2017 already includes the total of 2016 and it keeps accumulating from that point. This overstated the 2017 numbers.

I need to present each year running total separately.

 

Thanks!

NH

13 REPLIES 13
Highlighted

Hi Ashish,

 

I just had a chance to test your formula and it worked just fine, Thanks!! Not sure what I did wrong in the first place that didn't work for me. Maybe I should have thought about column instead of a new measure.

Anyway, the next step is a acummulated running average.

What needs to be added in order to get this function to work?

 

Best,

Nir H.

Highlighted

Hi,

 

Try this calculated column formula

 

=CALCULATE(SUM(CompanyPortalDataBase[PageVisit]),FILTER(CompanyPortalDataBase,CompanyPortalDataBase[Category]=EARLIER(CompanyPortalDataBase[Category])&&CompanyPortalDataBase[Year]=EARLIER(CompanyPortalDataBase[Year])&&CompanyPortalDataBase[Date]<=EARLIER(CompanyPortalDataBase[Date])))/CALCULATE(COUNTROWS(CompanyPortalDataBase),FILTER(CompanyPortalDataBase,CompanyPortalDataBase[Category]=EARLIER(CompanyPortalDataBase[Category])&&CompanyPortalDataBase[Year]=EARLIER(CompanyPortalDataBase[Year])&&CompanyPortalDataBase[Date]<=EARLIER(CompanyPortalDataBase[Date])))


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/

View solution in original post

Highlighted

Perfect!!!

 

Thank you Ashish.

Highlighted

You are welcome.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/

Helpful resources

Announcements
Community Conference

Power Platform Community Conference

Check out the on demand sessions that are available now!

Community Conference

Microsoft Power Platform Communities

Check out the Winners!

secondImage

Create an end-to-end data and analytics solution

Learn how Power BI works with the latest Azure data and analytics innovations at the digital event with Microsoft CEO Satya Nadella.

Top Solution Authors
Top Kudoed Authors