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
Greger1337
Frequent Visitor

Keep cumulative sum when filtering

I having trouble with my cumulative sum.

I have data from 29 months and I am calculating a rolling sum for the last 12 months like this:

Ackumu rullande 12 månader omsättning = 
CALCULATE([Omsättning]; 
          DATESINPERIOD('Date'[Date]; 
                        LASTDATE('BFO Transactions'[Date]);-12;MONTH
                       )
         )

The result looks like this:

 

rullande.JPG

The problem is I only want to show the periods when the rolling sum is a complete year so I filter it but the the cumulative rolling sum no longer starts at the beginning of my data set and the result looks like this:

 

rullande2.JPG

 

How can I keep the sum from changing when I change the time filter?

 

 

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Try adding another filter, ALL() to your CALCULATE().

 

CALCULATE([Omsättning],ALL('BFO Transactions','BFO Transactions'[Date]),DATESINPERIOD…)  

 

View solution in original post

2 REPLIES 2
Anonymous
Not applicable

Try adding another filter, ALL() to your CALCULATE().

 

CALCULATE([Omsättning],ALL('BFO Transactions','BFO Transactions'[Date]),DATESINPERIOD…)  

 

Thank you!

Ackumu rullande 12 månader omsättning = 
CALCULATE([Omsättning]; ALL('BFO Transactions'[Date]);
DATESINPERIOD('Date'[Date]; 
LASTDATE('BFO Transactions'[Date]);-12;MONTH)
)

This did exacly what I was after.

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.