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
electrobrit
Post Patron
Post Patron

Dax to sum the total using a relative date with a filter

This seems kind of simple but I can't get it to work using a relative date filter and another filter.
I have a table with a close date and status. 
If the status = Closed and close date is in last 2 months, I need to sum the total.  

NameClose_DateStatusTotal Revenue
A12/31/2020Closed$12,000
B12/4/2020Closed$18,000
C11/26/2020Closed$150,000
D1/1/2021Open

$4,200

E12/4/2020Closed$3,666
F2/2/2021Open$15,000
G3/5/2021Open$20,600

 

In this case, it would be $183, 666

Thank you for your help!

 
3 REPLIES 3
Anonymous
Not applicable

Try the following measure 

Measure = SUMX(FILTER('Table','Table'[Status]="Closed"),'Table'[Total Revenue])

Ensure you replace "Table" with your table name. 

@Anonymous this was not a solution. The orig request is adding a date filter in as well. was that an oversight in trying to help or were you just adding what you know for part of it?

Thank you, but the part that is missing is adding to that a relative date filter (close date in the last 2 months), how do I add that part into what you have provided? 

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.

Top Solution Authors