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
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
v-yohua-msft
Community Support
Community Support

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.

@v-yohua-msft 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
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.