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.
Hi,
I am wanting to sum the sales
(revenue) for the 13 past 13 month in a measure.
What would the code be to do this
Im thinking something like
=Calculate(sum(revenue),datesbetween(dateadd(calender(date),-13,Month),dateadd(today))
But it doesnt work.
C
Solved! Go to Solution.
I'm not sure you can have dateadd(today)
what about:
=
CALCULATE (
SUM ( [revenue] ),
DATESBETWEEN (
calendar[date],
DATEADD ( TODAY(), -13, MONTH ),
TODAY ()
)
)
Thanks for getting back, unfortunatly I am still receiving an error.
A table of Multiple values was supplied where a single value was expected
I amended the revenue to column3 as that is what it is called in the database.
=CALCULATE ( SUM ( [Column3] ), DATESBETWEEN ( Calendar1[Date], DATEADD ( Calendar1[Date], -13, MONTH ), TODAY () ) )
Brill! Works a treat!
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
109 | |
98 | |
77 | |
66 | |
54 |
User | Count |
---|---|
144 | |
104 | |
100 | |
86 | |
64 |