The ultimate Fabric, Power BI, SQL, and AI community-led learning event. Save €200 with code FABCOMM.
Get registeredEnhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends September 15. Request your voucher.
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.
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.
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
@rachaelwalker , try this measure, 'DATE'[DATE] is assumed from you Date table
CALCULATE(
SUM(REVENUE COLUMN),
'DATE'[DATE]>=DATEADD(TODAY(), -2, MONTH)
)
User | Count |
---|---|
14 | |
12 | |
7 | |
6 | |
5 |
User | Count |
---|---|
28 | |
19 | |
13 | |
7 | |
5 |