Forum Discussion

thorpyuk's avatar
thorpyuk
Icon for Helper III rankHelper III
6 years ago
Solved

Change Cumulative values to daily

Hi all, I have a chart displaying daily sales values for the current week split out by day, and another measure for 'last week to date' shown below which will calculate the cumulative sales for the ...
  • thorpyuk's avatar
    thorpyuk
    6 years ago

    Hi Rena, yes in the end i edited Amitchandak's code slightly to go 1 week back:

     

    NetSalesIncLW = 
    var _max = maxx(ALLSELECTED('db_v_BaseCalendar_TYLY'),'db_v_BaseCalendar_TYLY'[DateName])
    return
    CALCULATE(SUMX(db_v_SalesProduct, [NetSalesIncM]),FILTER(all('db_v_BaseCalendar_TYLY'),'db_v_BaseCalendar_TYLY'[WeekNo]=max('db_v_BaseCalendar_TYLY'[WeekNo])-1 && 'db_v_BaseCalendar_TYLY'[DateName]=max('db_v_BaseCalendar_TYLY'[DateName])))

     

    Thanks