Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
6 years ago

IFERROR

Hey there,

 

thanks for your support the post before!
I also have problems with a nested IFERROR and IFS formula out of excel I need to transform into PowerBI:

 

=IFERROR(IFS(AC2="NO";"NO";(AND(AC2="YES";AD2=False))=True;"YES";AC8(AND(AC2="YES";AD2=True))=True;(IF((Y2+AA2)>(Year(Today()));"NO";"YES")));"N/A")

 

This is my attempt:

Flag Overdue? RETROFITS =

IFERROR(IF(In Results[In Overhaul Window? RETROFITS]="NO","NO",
    IF(AND(In Results[In Overhaul Window? RETROFITS]="YES",Results[Overhaul already performed? RETROFITS]="False"),"YES",
    IF(AND(In Results[In Overhaul Window? RETROFITS]="YES",Results[Overhaul already performed? RETROFITS]="True"),
    IF(Results[Last Service Event Year]+Results[Overhaul Criteria RETROFITS]>=YEAR(TODAY()),"NO","YES"),"N/A")
 
Where is the error? Do you have an alternative?

 

9 Replies

  • Anonymous ,Can you share sample data and sample output in table format? Or a sample pbix after removing sensitive data.

     

    True = True() //boolean , 1 whole no  , "True" or "TRUE" as text

    Same is true for false

    False() as boolean

    • Anonymous's avatar
      Anonymous
      Not applicable

      • amitchandak's avatar
        amitchandak
        Super User

        Anonymous , In is wrong. If the table name is 'In Result', it should come in a single quote.

         

        You can alse give and condition like if( [A] ="Yes" && [B] = "Yes" , "Yes","No")

        if(and([A] ="Yes" , [B] = "Yes" ) ,"Yes","no")

         

        You can also use the switch

        SWITCH (
        TRUE(),
        [A] ="Yes" && [B] = "Yes", "Yes",
        [C] ="Yes" && [B] = "Yes", “Yes”,
        “No”
        )

  • Anonymous's avatar
    Anonymous
    Not applicable

    HI Anonymous ,

     

    USe SWITCH()

     

    and try something like this

     

    Column =
    SWITCH (
        TRUE (),
        Results[Overhaul Window? RETROFITS] = "NO", "NO",
        Results[Overhaul Window? RETROFITS] = "YES"
            && Results[Overhaul already performed?RETROFITS] = "False", "YES",
        Results[Overhaul Window RETROFITS] = "YES"
            && Results[Overhaul already performed RETROFITS] = "True", "YES",
        Results[Last Service Event Year] + Results[Overhaul Criteria RETROFITS]
            >= YEAR (
                TODAY ()
            ), "No",
        "YES", "N/A"
    )
    

     

    Regards,
    Harsh Nathani
    Did I answer your question? Mark my post as a solution! Appreciate with a Kudos!! (Click the Thumbs Up Button)

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

    Hi , Anonymous 

    Could you please tell me whether your problem has been solved?
    If yes, you could accept the helpful answer as solution. You also could share your own solution here. For now, there is no content of description in the thread. If you still need help, please share more details to us.

     

    Best Regards,
    Community Support Team _ Eason