Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
3 years ago
Solved

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

  • pls try this

    OOO Change = 
    VAR _NEXTDAY = CALCULATE(SUM('Table'[OOO]) , NEXTDAY('Table'[Date])) 
     VAR _Value = SUM('Table'[OOO])
     RETURN
     IF(_NEXTDAY,_Value - _NEXTDAY )

     

    • Anonymous's avatar
      Anonymous
      Not applicable

      No its not working all cell are empty

    • Anonymous's avatar
      Anonymous
      Not applicable

      Thanks Its worked

  • Uzi2019's avatar
    Uzi2019
    Icon for Community Champion rankCommunity 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

  • Anonymous's avatar
    Anonymous
    Not 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

  • Anonymous's avatar
    Anonymous
    Not 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.

  • Anonymous's avatar
    Anonymous
    Not applicable

     

    Yellow colour are Input and Green one is expected values

    • Ahmedx's avatar
      Ahmedx
      Icon for Super User rankSuper 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)