Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
einrikr
Frequent Visitor

IF function with multiple statements

Hello all,

 

I hope I'm not posting a topic that's already answered somewhere but I couldn't find it. 

 

I'm trying to solve the following.

I have a list of findings, and columns telling me what the deadline for the finding is, and wether or not the finding has been validated. 

If it is validated, the file shows a date stamp and if no validation has been done, the cell is blank. 

What I'm trying to do, is to create a measure that will tell me how many validations are timely vs not timely. 

To do that, I need an IF statement (I think) that says something like this: 

OnTime =  IF(

      OR( 'table'[Deadline] = "blank", 'table'[Deadline] > 'table'[Validation date] ), "Timely", "Not Timely". )

 

If I make a measure like this, it tells me that the max argument for the OR function is 2, so I guess I'm misusing the function. 

Can someone please help me with this?  I'm fairly new to DAX and like to solve this!

1 ACCEPTED SOLUTION
az38
Community Champion
Community Champion

hi @einrikr 

try replace "," to ";"

or use simple statement like

OnTime =  IF(
     'table'[Deadline] = "blank" || 'table'[Deadline] > 'table'[Validation date] , "Timely", "Not Timely" )

and what the point "." in the end of your statement?

 

do not hesitate to give a kudo to useful posts and mark solutions as solution


do not hesitate to give a kudo to useful posts and mark solutions as solution
LinkedIn

View solution in original post

3 REPLIES 3
v-shex-msft
Community Support
Community Support

HI @einrikr,

I'd like to suggest you extract current values and stored to variables, then you can compare them in OR function without that error messages.

Measure =
VAR _deadline =
    MAX ( 'Table'[Deadline] )
VAR _validation =
    MAX ( 'Table'[Validation date] )
RETURN
    IF (
        OR ( _deadline <> BLANK (), _deadline > _validation ),
        "Timely",
        "Not Timely"
    )

Regards,

Xiaoxin Sheng

Community Support Team _ Xiaoxin
If this post helps, please consider accept as solution to help other members find it more quickly.
amitchandak
Super User
Super User

Try like

OnTime =  IF( OR( isblank('table'[Deadline]) , 'table'[Deadline] > 'table'[Validation date] ), "Timely", "Not Timely")
	  
	  
OnTime =  IF(isblank('table'[Deadline]) || 'table'[Deadline] > 'table'[Validation date] ), "Timely", "Not Timely")

 

Appreciate your Kudos. In case, this is the solution you are looking for, mark it as the Solution.
In case it does not help, please provide additional information and mark me with @

Thanks. My Recent Blogs -Decoding Direct Query - Time Intelligence, Winner Coloring on MAP, HR Analytics, Power BI Working with Non-Standard TimeAnd Comparing Data Across Date Ranges
Connect on Linkedin

az38
Community Champion
Community Champion

hi @einrikr 

try replace "," to ";"

or use simple statement like

OnTime =  IF(
     'table'[Deadline] = "blank" || 'table'[Deadline] > 'table'[Validation date] , "Timely", "Not Timely" )

and what the point "." in the end of your statement?

 

do not hesitate to give a kudo to useful posts and mark solutions as solution


do not hesitate to give a kudo to useful posts and mark solutions as solution
LinkedIn

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.