Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

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
Super User

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

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
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.