Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
7 years ago
Solved

IF STATEMENT MULTIPLE CONDITIONS

Hi i need a formula with if statement with multiple conditions.

Check below what i need


 

  • Hi Anonymous 

    Is this problem sloved? 

    If it is sloved, could you kindly accept it as a solution to close this case?

    If not, please let me know.

     

    Best Regards

    Maggie

4 Replies

  • v-juanli-msft's avatar
    v-juanli-msft
    Community Support

    Hi Anonymous 

    For the second condition, 

    if End date Project of last project differs one day of previous project.

    However, in your provided example (result 1456 in New Hours column), 

    the condition should be "Start date Project of last project differs one day of End date Project  of previous project"

    Start date Project of last project=2019/1/21

    End date Project  of previous project=2019/1/20

     

    If i misunderstand you, please let me know.

     

    Best Regards
    Maggie

     

     

     

    • Anonymous's avatar
      Anonymous
      Not applicable

      Hi Maggie,

       

      you are right. can you help me with the formula?

      • v-juanli-msft's avatar
        v-juanli-msft
        Community Support

        Hi Anonymous 

        Is this problem sloved? 

        If it is sloved, could you kindly accept it as a solution to close this case?

        If not, please let me know.

         

        Best Regards

        Maggie

  • v-juanli-msft's avatar
    v-juanli-msft
    Community Support

    Hi Anonymous 

    Create a new column

    previous value =
    CALCULATE (
        SUM ( Table1[hours] ),
        FILTER (
            ALLEXCEPT ( Table1, Table1[emp id], Table1[customer id] ),
            Table1[end date project]
                = EARLIER ( Table1[start date project] ) - 1
                && Table1[reason] = "agreement"
        )
    )
    
    final result = [hours]+[previous value]

     

    Best Regards
    Maggie

     

    Community Support Team _ Maggie Li
    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.