Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
6 years ago
Solved

Creating cumulative (running) total for active contracts

Hi, I'm relatively new to DAX so any help would be appreciated. 

 

I have a contracts table with MRR, ContractedStartDate and ContractedEndDate. 

I need to create a table that would show a running total MRR of all contracts that are active during any given period of time. I also have a calendar table by which i would filter the date on the report. 

This is my approach:

 

Running total =
CALCULATE(
         SUM(Contracts[MRR]),
         FILTER(ALLSELECTED(Contracts),
          Contracts[ContractedStartDate] <=MAX(Contracts[ContractedStartDate])))
 
i think the last line is where im going wrong. im slightly confused how i should be filtering the date and whether i should be using the calendar table instead?
 
Thanks