Forum Discussion
sv11
7 years agoHelper I
Previous day value
Hi, I am trying to pull up the "DataPointValue" for the privious day (hoping to use this in a calculation). Below is the snapshot of the data: Current Formula used: Previous ro...
- Anonymous7 years ago
sv11,
Is DataPointValue as existing field in your table? Please check my PBIX file.
Regards,
Lydia
sv11
7 years agoHelper I
Anonymous,
Thank you for your response and insight on DAX.
I have made changes to DAX as suggested, but I am still having trouble in pulling in the correct Previous value.
This did solve part of my requirement (Starting with 0).
Please find the snapshot below:
Ideally, the highlighted values should be the same.
Here is the DAX code I used:
Previous row1 =
VAR _PreviousDate = MAXX(FILTER(ALL(Table), Table[AsOfDate] < EARLIER(Table[AsOfDate]) && Table[InstrumentDescription] = EARLIER(Table[InstrumentDescription])), Table[AsOfDate])
VAR _Previous = MAXX(FILTER(ALL(Table), Table[AsOfDate] = _PreviousDate), Table[DataPointValue])
RETURN
IF(ISBLANK(_Previous), 0, _Previous)
I really appreceate your help.
Thanks