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
August 2022 update 768x460.jpg

Check it Out!

Click here to learn more about the August 2022 updates!

August 1 episode 9_no_dates 768x460.jpg

The Power BI Community Show

Watch the playback when Priya Sathy and Charles Webb discuss Datamarts! Kelly also shares Power BI Community updates.

Power Platform Conf 2022 768x460.jpg

Join us for Microsoft Power Platform Conference

The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.

Top Solution Authors
Top Kudoed Authors