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

Help with cumulative totals

Not having fun with cumulative totals at all. 

I have a fact table with a column for dates ('Snapshot Date') and a column for units sold ('No of Homes').

I've had some success with this:

 

Running Total for Summary Table =
CALCULATE(
SUM('Fact Table'[No of Homes]),
FILTER(ALLEXCEPT('Fact Table','Fact Table'[Source]),
'Fact Table'[Snapshot Date] <= MAX('Fact Table'[Snapshot Date])))

And it seems to work for a table seperating everything out by category. However if i do the same thing for for each single reference though, it shows that it doesn't carry a unit sold in say 2015 right the way through all columns of the table (imagine the table of years 2010 to 2050 - the  unit sold in 2015 would only appear under 2015 column, and not in each and every column after that, presumably as there is no reference for that item in 2016, 2017 and so on in the main table. The columns are either snaphot date itself, or financial year columns from a date table. Both result the same way.

I did try a different way of doing this by unpivoting the column, filling in nulls with 0 (so each reference would have its own 'blank' value for each possible year), and then unpivoting again, but it was very cumbersome and memory intensive and i really want to avoid this if there is any alternative.
 

I've been trying various things for the best part of a day! Please help!

 

Many thanks 🙂
3 REPLIES 3
GlassShark1
Helper III
Helper III

Cumulative problem.PNG

amitchandak
Super User IV
Super User IV

@GlassShark1 ,Can you share sample data and sample output in table format? Or a sample pbix after removing sensitive data.



Did I answer your question? Mark my post as a solution! Appreciate your Kudos!!
Dashboard of My Blogs !! YouTube Channel !! Connect on Linkedin

Proud to be a Super User!

SourceRefSalesDateNote

X11031/03/2015 
X1931/03/2016 
X1831/03/2017 
X4731/03/2018 
X5331/03/2019 
Y6531/03/2015 
Y
Y
7731/03/2016 
Y8431/03/2017 
Z9231/03/2014 
Z10731/03/2016 
Z
Z
11431/03/2019 
Z
Z
Z
Z
12731/03/2020 
X100831/03/2014 

Helpful resources

Announcements
User Groups Public Preview

Join us for our User Group Public Preview!

Power BI User Groups are coming! Make sure you’re among the first to know when user groups go live for public preview.

March Update

Check it Out!

Click here to read more about the March 2021 Updates!

secondImage

The largest Power BI virtual conference

100+ sessions, 100+ speakers, Product managers, MVPs, and experts. All about Power BI. Attend online or watch the recordings.