Forum Discussion
Need help with YTD measures.
- 1 year ago
ashmitp869 you have similar post, check reply on the another post.
Hi ashmitp869 ,
I suggest you check that the DATESYTD('Date'[Date], "6/30") in your DAX is returning the date range you want. Normally, when you specify a year-end date in the DATESYTD function, that date is considered the new year-end date. Therefore, the function calculates the new year-start date from the day after the specified year-end date. For example, if you specify a year-end date of June 30, the new year-start date will be July 1. According to your needs, I recommend you to use DATESBETWEEN.
YTD - Billed(Ex-GST) TEST =
VAR _maxDate = MAX(vFactBudgetActuals[Transaction Date])
VAR OldSystemRevenue =
CALCULATE(
[Revenue Amount] - SUM(vFactBudgetActuals[Cost Amount]),
vFactBudgetActuals[Service ID] = "REVENUE",
DATESBETWEEN('Date'[Date],DATE(2024,7,1),DATE(2025,2,21))
)
VAR NewSystemRevenue =
CALCULATE(
SUM(PJC[TOTAMTSR]),
DATESBETWEEN('Date'[Date],DATE(2025,2,22),MAXX(ALL('Date'),'Date'[Date]))),
PJC[CATEGORY] = "REVENUE"
)
RETURN
OldSystemRevenue + NewSystemRevenue
——————————————————————————————————————————————————
If my answer helps you solve the problem, please accept my answer as a solution and let it be seen by more people in need.
Best regards,
Mengmeng Li