@accumulate
1 TopicAccumulate MTD Sales up to a selected date
Hi All, I tried to create DAX to calculate the Accumulate MTD Sales up to the seleted date from Date Slicer. However, it cant work once I have selected a date value. It works when no Date is selected: It can't work when a date is selected: Below 2 DAXs are tried but not work. Anyone has idea how to achieve it WITHOUT closing the interacton between the date and visual? Cumulative1 = var maxdate = Max('Date'[Date]) var mindate = Date(Year(maxdate),Month(maxdate),1) RETURN CALCULATE(sum(Fact[NetSales]), ALL('Date'), Fact[TxnDate] <= maxdate, Filter(ALL('Date'[Date]),'Date'[Date]<=max(Fact[TxnDate])) ) Cumulative2 = var maxdate = Max('Date'[Date]) var mindate = Date(Year(maxdate),Month(maxdate),1) RETURN IF(CALCULATE(max('Fact'[TxnDate]),ALL('Date'[Date]))<= maxdate, CALCULATE(sum(Fact[NetSales]), ALL('Date'), Filter(ALLSELECTED(Fact[TxnDate]),Fact[TxnDate]<= maxdate) ) ) Here is the sample pbix: Accumulate MTD.pbix Many Thanks! TracySolved1.3KViews0likes5Comments