cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
jetboy2k
Helper I
Helper I

Filtering a table over two date ranges

I have a table with just over 9M rows. Three of the columns in these rows are ActivationDate, RevenueDate, and Revenue. Customers start generating revenue as soon as they're activated, and their generated revenue is tracked on a daily basis.

 

What I need to do is create a cumulative total over any 12 month period that sums up the total revenue generated in the first month by all customers who have activated in that month, the total revenue generated in the second month by all customers who have activated in the first and second months, the total revenue generated in the third month by all customers who have activated in the first, second, and third months, etc., etc., etc.

 

I added a timeline slicer to the report and created two measures:

 

MinDate = MIN(Revenue[Day_Date])

MaxDate = MAXX(Revenue, Revenue[Day_Date])

 

I've confirmed that these measures do populate with the first and last dates selected from the Timeline slicer.

 

I then created the following measure:

 

WindowRev = CALCULATE(SUM(Revenue[Revenue]), FILTER(Revenue,DATESBETWEEN(Revenue[RevenueDate],[MinDate], [MaxDate])),FILTER(Revenue,DATESBETWEEN(Revenue[ActivationDate],[MinDate], [MaxDate])))

 

I'm grouping the WindowRev amount by the Month and Year of the RevenueDate. I thought that the above formula would have generated the cumulative total that I needed, by filtering out the Revenue table so that it only included revenue generated during the selected date range by only the customers that activated during that same date range, but it's giving me the full montly totals for each month, not a cumulative amount.

 

If anyone has any pointers or suggestions on how I can do this, that is greatly appreciated.

 

Thank you.

1 ACCEPTED SOLUTION
jetboy2k
Helper I
Helper I

Figured it out. I needed two timeline slicers, one for the RevenueDate date range and one for the ActivationDate date range. Once I added the second slicer I got the running cumulative totals I needed.

View solution in original post

1 REPLY 1
jetboy2k
Helper I
Helper I

Figured it out. I needed two timeline slicers, one for the RevenueDate date range and one for the ActivationDate date range. Once I added the second slicer I got the running cumulative totals I needed.

Helpful resources

Announcements
September Update

Check it Out!

Click here to learn more about the September 2022 updates!

Power BI Dev Camp Session 26

Check it Out!

Mark your calendars and join us on Thursday, September 29 at 11a PDT for a great session with Ted Pattison!

Top Solution Authors