Forum Discussion

DeeS's avatar
DeeS
New Member
9 years ago
Solved

DAX error message

Hi everyone,

 

I really hope you can help, I'm completely new to PowerBI and DAX but am giving creating a new column a go in my dataset. I have the below but when I run it through a DAX checker and it says it is missing a syntax but doesn't tell me where unfortunately.

 

SLA Met = IF(AND([State Open] = "0", [Incident Type] = "Incident", [Work Time Duration Formatted] >3), "Yes", IF(AND([State Open] = "0", [Incident Type] = "Service Request"), "NO", "Open"))

 

Am I not able to have 3 conditions for my first section? I intend to add a 3rd condition to the 2nd result also but want to nail this one to begin with.

 

Effetively in the end I want to build it up so that the results show as below:

 

State Open    Incident Type            Work Time Duration Formatted    Result

0                     Incident                                >3                                             Miss

0                     Incident                                <=3                                           Hit

0                     Service Request                   >5                                              Miss

0                     Service Request                   <=5                                            Hit

 

Anything else would be "Open"

 

Thanks so much if anyone is able to assist, hopefully it's an easier one?

 

 

 

  • The AND function has only two arguments, use the && operator instead so it's easier to write.

    SLA Met =
    IF (
        [State Open] = "0"
            && [Incident Type] = "Incident"
            && [Work Time Duration Formatted] > 3,
        "Yes",
        IF ( [State Open] = "0" && [Incident Type] = "Service Request", "NO", "Open" )
    )

2 Replies

  • marcorusso's avatar
    marcorusso
    Most Valuable Professional

    The AND function has only two arguments, use the && operator instead so it's easier to write.

    SLA Met =
    IF (
        [State Open] = "0"
            && [Incident Type] = "Incident"
            && [Work Time Duration Formatted] > 3,
        "Yes",
        IF ( [State Open] = "0" && [Incident Type] = "Service Request", "NO", "Open" )
    )