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
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
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.