Reply
Highlighted
Member
Posts: 48
Registered: ‎05-23-2017
Accepted Solution

Date Difference with blank values

Hello,

 

I have an issure with this code, that calculates the transit time between two dates, when the last date is blank. Is there a way to add a function to that code, so it gives a blank value when one of the two dates are blank?

 

count = var calendarTable= CALENDAR([Start Date],[End Date])
var exceptDate=CALCULATETABLE(VALUES('Situational Holidays'[situationDate]),FILTER(ALL('Situational Holidays'),[Entity]=EARLIER(Dates[Origin Entity])))
var filtered=ADDCOLUMNS(EXCEPT(calendarTable,exceptDate),"Day Of Week",WEEKDAY([Date],1))
return
COUNTROWS(FILTER(filtered,[Day Of Week]<>6&&[Day Of Week]<>7))

Accepted Solutions
Community Support Team
Posts: 4,002
Registered: ‎07-09-2016

Re: Date Difference with blank values

@zaidmasad,

 

You may use ISBLANK Function as follows.

IF ( ISBLANK ( [Start Date] ) || ISBLANK ( [End Date] ), BLANK (), [count] )
Community Support Team _ Sam Zha
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post


All Replies
Member
Posts: 129
Registered: ‎07-26-2017

Re: Date Difference with blank values

Hi @zaidmasad,

 

Try to use IF(OR(date1="", date2= ""), "", "your calculation")

Member
Posts: 48
Registered: ‎05-23-2017

Re: Date Difference with blank values

@bsas thank you, but it didnt work with me

Member
Posts: 129
Registered: ‎07-26-2017

Re: Date Difference with blank values

What is the issue?

Community Support Team
Posts: 4,002
Registered: ‎07-09-2016

Re: Date Difference with blank values

@zaidmasad,

 

You may use ISBLANK Function as follows.

IF ( ISBLANK ( [Start Date] ) || ISBLANK ( [End Date] ), BLANK (), [count] )
Community Support Team _ Sam Zha
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.