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

Join us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. Register now.

Reply
p_fehrenbach
Frequent Visitor

Difference between two columns (date & time)

Hello togehter,

 

is there a way to calculate the difference in hour + / - between two columns?

I have  column with Date / Time where the ticket is opend, the second columune include the Date / Time SLA.

So I need the difference, if the SLA is fall belows or they is exceeded.

 

Many thanks for help.

 

Unbenannt.PNG

1 ACCEPTED SOLUTION
3 REPLIES 3
speedramps
Community Champion
Community Champion

HI p_fehrenbach 

 

Please consider using this solution in the M query .....

 

Define both the sla duration and actual duration with date time data types.

 

Add a column with Difference = sla duration - actual duration

Transform the Difference data type to minutes

Filter where the Difference  < 0

 

@speedramps 

 

Many thanks for the answer. I had already tried that. unfortunately power query changes the type when I load the data into the model, from time to decimal. If I put the data back in time in the model, all decimal numbers are positive.

 

(The negativ value in this scenario is good one)

 

For Example in the last Row:

 

 

 

We finished te ticket at the 22.10.2019 16:30:00

It could have been closed until 23.10.2019 12:40.

The Result is + 20:10:00 hours.

The Result have to be - 20:10:00 hours.

 

 

Unbenannt.PNG

Helpful resources

Announcements
July PBI25 Carousel

Power BI Monthly Update - July 2025

Check out the July 2025 Power BI update to learn about new features.

Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 community update carousel

Fabric Community Update - June 2025

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