Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

To celebrate FabCon Vienna, we are offering 50% off select exams. Ends October 3rd. Request your discount now.

Reply
rachaelwalker
Resolver III
Resolver III

How to sum a value and exclude anything that is over 1 month old

How do I create a measure that sums the total of expected revenue but excludes anything over 2 months old. I only want to include the previous month and any dates moving forward. Example outlined in red below. 

I have a calendar table in my data model. 

rachaelwalker_0-1710191355888.png

 

 

3 REPLIES 3
Anonymous
Not applicable

Hi, @rachaelwalker 

You can try the following DAX:

Expected Revenue Last Month Forward = 
CALCULATE(
    SUM('Table'[Expected]),
    FILTER(
        ALL('Calendar'),
        'Calendar'[Date] >= EOMONTH(TODAY(), -2) + 1 &&
        'Calendar'[Date] <= EOMONTH(TODAY(), 0)
    )
)

 

If it does not help, please provide more details with your desired output and pbix file without privacy information (or some sample data)

 

How to Get Your Question Answered Quickly 

Best Regards

Yongkang Hua

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

@Anonymous This is returning a repeating number that is showing an incorrect total.

rachaelwalker_0-1710256546063.png

Here is a pbix file with sample data. The file includes the expected results I am looking for https://drive.google.com/file/d/1T_U0XFpcMWJ3Jfv3sgNZQ2YJKyjgv5bS/view?usp=sharing 

Walter_W2022
Resolver II
Resolver II

@rachaelwalker , try this measure, 'DATE'[DATE] is assumed from you Date table

CALCULATE(
SUM(REVENUE COLUMN),
'DATE'[DATE]>=DATEADD(TODAY(), -2, MONTH)
)

Helpful resources

Announcements