Forum Discussion
Difference betwwen dates and Yesterday values
What I'm trying to achieve here is changing from 'OOO' to 'yesterday.' However, when I attempt this, I'm not obtaining the value that I'm getting in Excel.
this is the formula I'm using
"OOO Change = [OOO]-CALCULATE( AVERAGE(OTA_INSIGHT_DATA[DT_OUT_OF_ORDER]) , OTA_INSIGHT_DATA[REPDATE] <> TODAY())"
and there are the accurate values I Want
pls try this
OOO Change = VAR _NEXTDAY = CALCULATE(SUM('Table'[OOO]) , NEXTDAY('Table'[Date])) VAR _Value = SUM('Table'[OOO]) RETURN IF(_NEXTDAY,_Value - _NEXTDAY )
8 Replies
- Ahmedx
Super User
pls try this
OOO Change = VAR _NEXTDAY = CALCULATE(SUM('Table'[OOO]) , NEXTDAY('Table'[Date])) VAR _Value = SUM('Table'[OOO]) RETURN IF(_NEXTDAY,_Value - _NEXTDAY )- AnonymousNot applicable
No its not working all cell are empty
- AnonymousNot applicable
Thanks Its worked
- Uzi2019
Community Champion
Hi Anonymous ,
Would you please give expected out that you want in the table?
Just simply write the table in excel what should be your input and what is you expected output for each row.
If my post helps you please give kudos and please accept my solution - AnonymousNot applicable
As I mentioned, I want to calculate the difference between consecutive days. For example:
- On October 1, 2023, there were 5 items.
- On October 2, 2023, there were 4 items, resulting in a difference of 1.
However, on October 2, 2023, there were 4 items, and on October 3, 2023, there were also 4 items, so there is no difference between these two days
- AnonymousNot applicable
In the image, you can see that on October 1, 2023, the value 'OOO' is 5, and the difference appears to be calculated based on the value from September 30, 2023.
- AnonymousNot applicable
Yellow colour are Input and Green one is expected values
- Ahmedx
Super User
pls try this
OOO Change = VAR _PREVIOUSDAY = CALCULATE(SUM('Table'[OOO]) , PREVIOUSDAY('Table'[Date])) VAR _Value = SUM('Table'[OOO]) RETURN IF(_PREVIOUSDAY, _PREVIOUSDAY -_Value)