## Desktop

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

# 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])))
return
COUNTROWS(FILTER(filtered,[Day Of Week]<>6&&[Day Of Week]<>7))```

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

## Re: Date Difference with blank values

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.

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

## Re: Date Difference with blank values

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?

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

## Re: Date Difference with blank values

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.