Forum Discussion
DAX - Running Total YTD
Hi,
I am calculating the MTD and YTD for which I have used below statements.
MTDValue = TOTALMTD(SUM(RetailerSummary[Tran_Amount]),RetailerSummary[Transaction Date])
& for
YTDValue =
VAR RowDate = RetailerSummary[Transaction Date]
RETURN CALCULATE (SUM(RetailerSummary[Tran_Amount]),
FILTER(RetailerSummary,RetailerSummary[Transaction Date]<=RowDate
&&
YEAR(RetailerSummary[Transaction Date] = YEAR(RowDate))
))
The issue I am facing in YTD is that it calculate YTD value instead of FiscalYTD.
Also on "Visual level filters" I am taking the max of YTD value. Is this method correct or not? Right now I am getting the correct values (YTD and not fiscal YTD)
Could anyone please help me to fix this issue?
Thanks,
Anupam
16 Replies
- PavelR
Solution Specialist
anupampandey I would suggest to use DATESYTD function in CALCULATE function and use the second parameter of DATESYTD that defines year end date.
Regards.
Pavel
- anupampandey
Helper III
can you please provide me the syntax for the same?
Thanks,
Anupam
- PavelR
Solution Specialist
YTD_fiscal = CALCULATE(SUM(Transactions[Value]);DATESYTD('Date'[Date];"06-30"))Put your columns in formula.
Regards.
Pavel