Forum Discussion

Burubear's avatar
Burubear
Icon for Helper I rankHelper I
5 years ago
Solved

MAX value for each date until Goal (not running total)

Hello everyone!   Been looking into dax solutions for my scenario but can't seem to get the right for my spefic scenario. For my report, I currently have a data set like this: (below is just a samp...
  • JW_van_Holst's avatar
    5 years ago

    It's a bit hard to understand your problem. 
    General Advice:
    1. always unpivot your data before you start in DAX
    2. work with deltas in your columns (instead of cumulatives)

     

    Day Savings = 
    VAR __filter = FILTER('Table', 'Table'[Location] = EARLIER('Table'[Location]) && 'Table'[Date] = EARLIER('Table'[Date]) -1)
    VAR __cumSavingsPreviousDay = MAXX(__filter, 'Table'[**bleep** Savings])
    RETURN
    'Table'[**bleep** Savings] - __cumSavingsPreviousDay

     


    However neither should represent a problem in your case. For clarity I made a screenshot of a matrix and a slicer and they give the result you want (as I understand it)