Starting December 3, join live sessions with database experts and the Microsoft product team to learn just how easy it is to get started
Learn moreShape the future of the Fabric Community! Your insights matter. That’s why we created a quick survey to learn about your experience finding answers to technical questions. Take survey.
Hi folks,
I need to calculate the past 12 months based on the max date. Please, any idea?
I try dateadd and it is not working.
Solved! Go to Solution.
Hi @Anonymous ,
Dateadd is a table function and cannot be directly useful for metric values. You can see the results returned by the dateadd function by creating a calculated table.
You can try below formula:
M_ =
CALCULATE (
SUM ( 'Table 2'[value] ),
DATESBETWEEN (
'Table 2'[Date],
MAX ( 'Table 2'[Date] ) - 365,
MAX ( 'Table 2'[Date] )
)
)
Best Regards,
Adamk Kong
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi @Anonymous ,
Dateadd is a table function and cannot be directly useful for metric values. You can see the results returned by the dateadd function by creating a calculated table.
You can try below formula:
M_ =
CALCULATE (
SUM ( 'Table 2'[value] ),
DATESBETWEEN (
'Table 2'[Date],
MAX ( 'Table 2'[Date] ) - 365,
MAX ( 'Table 2'[Date] )
)
)
Best Regards,
Adamk Kong
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
@Anonymous 12_months = EOMONTH( [Max_sent_payment], -13) + 1
You may find this helpful - https://community.powerbi.com/t5/Community-Blog/To-bleep-With-Time-Intelligence/ba-p/1260000
Also, see if my Time Intelligence the Hard Way provides a different way of accomplishing what you are going for.
https://community.powerbi.com/t5/Quick-Measures-Gallery/Time-Intelligence-quot-The-Hard-Way-quot-TITHW/m-p/434008
@Anonymous try the below
Past_12_Months_Start_Date = DATEADD(MAX('All Expenses'[Sent for Payment Date]), -12, MONTH)
Did I answer your question? Mark my post as a solution! Appreciate your Kudos !!
Yeah, that was my first approach. However, it did not work.
Your insights matter. That’s why we created a quick survey to learn about your experience finding answers to technical questions.
Check out the November 2024 Power BI update to learn about new features.
User | Count |
---|---|
93 | |
88 | |
83 | |
76 | |
49 |
User | Count |
---|---|
145 | |
140 | |
109 | |
68 | |
55 |