daily difference
1 TopicHelp with Dax - Day on Day difference, with MTD and YTD
Hi, can you please assist with my DAX issue? I have this data - see table below: The Day on Day difference is taking the current day sales and subtracting the previous day sales. This was achieve using the dax below: Day on Day difference = VAR currentDate = MAX('Date'[Date]) VAR priorDate = CALCULATE(MAX('Date'[Date]), ALL('Date'[Date]), 'Date'[Date] < currentDate) VAR priorDateSales = CALCULATE(SUMX('Sales','Sales'[DailySales), 'Date'[Date] = priorDate) VAR CurrentDaySales = CALCULATE(SUMX('Sales','Sales'[DailySales), 'Date'[Date] = currentDate) VAR daydiff = CurrentDaySales-priorDateSales RETURN daydiff The problem I have is I need the YTD and MTD totals to be used in a Card Visual, but i only get the yesterday value (for 17th July) as you see in the table above. Please how do I calculate the YTD and MTD totals for the Day on Day difference? Thanks. Ad1.9KViews0likes6Comments