Forum Discussion

Grande's avatar
Grande
Frequent Visitor
5 years ago
Solved

If statement not working

Any help appriciated.. getting ERROR message with below condtion
 
P1 = IF(VW_ORT[Partime_Num.?] = 2, DIVIDE (VW_ORT[Annual Salary (Local Currency)], IF(VW_ORT[Partime_Num.?] = 1,(VW_ORT[Annual Salary (Local Currency)]))))
  • Grande , it looks like you are authoring a measure, aren't you? If so, you might try,

     

    P1 =
    VAR __pt = MAX ( VW_ORT[Partime_Num.?] )
    VAR __as = MAX ( VW_ORT[Annual Salary (Local Currency)] )
    RETURN
        IF ( __pt = 2, DIVIDE ( __as, IF ( __pt = 1, __as ) ) )

     

4 Replies

  • CNENFRNL's avatar
    CNENFRNL
    Community Champion

    Grande , it looks like you are authoring a measure, aren't you? If so, you might try,

     

    P1 =
    VAR __pt = MAX ( VW_ORT[Partime_Num.?] )
    VAR __as = MAX ( VW_ORT[Annual Salary (Local Currency)] )
    RETURN
        IF ( __pt = 2, DIVIDE ( __as, IF ( __pt = 1, __as ) ) )

     

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

    Hi Grande ,

     

    Even if you want to create a calculated column, this formula has a logic error.

    Or Is this what you want?(30/20 =1.5)

     

    Best regards,
    Lionel Chen

    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

     

     

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

    Hi Grande ,

     

    Has your problem been solved?

     

    Best regards,
    Lionel Chen

    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

  • Grande's avatar
    Grande
    Frequent Visitor

    I would like to creted the below formaula for the which is giving me error Please help me..

     

    Annual Salary (USD) - AOP FX Rates + (Annual Salary (USD) - AOP FX Rates * Fringe Rate)

    Excel Formula =IFERROR(BR31765+(BR31765*BP31765),"NA")

    data Values : 

     Fringe Rate = 15%
    AOP FY20 FX Rates = 1
    Annual Salary (USD) - AOP FX Rates = 152,360
    Annual Salary + Benefits (USD) = 175,774 

     

    I created the formula but it does not giving me the correct Results 

    I should get the Result = 175774

     

     

    Please help me