Forum Discussion
Function DATESINPERIOD doesn't work properly
- 1 year ago
Hi antarizana
I really sorry for the confusion here is the refined DAX that will help you to resolve our issue.
If you still need facing anu issues please share the sample data so that i can help you address your requiement.
Updated DAX
Rolling12Months =
VAR __SelectedDate = MAX('Date'[Date])
VAR __StartDate = EDATE(__SelectedDate, -11) // includes 12 months
RETURN
CALCULATE(
SUM(YourTable[Amount]),
DATESBETWEEN(
'Date'[Date],
__StartDate,
__SelectedDate
)
)
If the above information is helpful, please give us Kudos and mark the response as Accepted as solution.
Best Regards,
Community Support Team _ C Srikanth.
Hi ,
Ensure your monthly amounts are calculated in a measure, not a calculated column, as measures recalculate dynamically for the context (like time periods).
Use the corrected monthly amounts for the rolling sum, ensuring the measure evaluates the MonthlyAmount, not the cumulative Amount column
Define a measure to calculate MonthlyAmount dynamically using Parallelperiod
If this post helps please do give a kudos and accept this as a solution
Thanks in Advance
Dear people, thank you so much for the warm welcome and the help you are offering me (and badge too 🙂 . It's much easier now knowing that I'm not alone in this...
Since I am a Power BI user only recenty, it's obvious that I'm making some mistake, so it might be best to show you all four formulas I'm using.
Screenshot below.
I also tried the ALLEXCEPT formula, but it doesn't work properly.