Quantcast
Channel: Desktop topics
Viewing all articles
Browse latest Browse all 216047

Calculate difference between dates in Power BI

$
0
0

Hello Guys,

 

I need to calucate difference between 2 dates and the output should be in  hours and minutes. It is possible that one of the date columns could be null/blank.

 

I have used DATEDIFF function but because one of the date could be blank and/or the difference between both the dates could be negative (i.e. Start Date is less than End Date) I am unable to calcuate the output using DATEDIFF function.

 

As you can see in below figure there are 3 columns with dates; column A, B & C. The result set that I want is also attached below. The result set is Column B - Column A.

 

Can you please suggest how to handle the blanks and what to do if column A is lower value than column B?

 

 

Dates.PNG

 

 

Result Set.PNG

 

 

 

 


Viewing all articles
Browse latest Browse all 216047

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>