Forum Discussion
MAX value for each date until Goal (not running total)
- 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)
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)
Thank you for the guidelines, I'll take note of that for futureu data sets as well.
EDIT: Sorry I didn;t notice that you are referring to making Dax Columns and not measure. All is good now. Thank you so much
As for the Dax formula, is it possible to show me the Formula bar as well? I tried following your formula above but for the "EARLIER" function, it won't allow me to use a table column. There are no table columns in the suggested fields after EARLIER then when I just manually type it, it won't take it. Let me know if i'm reading the formula wrong