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
Nella
Frequent Visitor

How to subtract time

Hi,

 

I'm fairly new to Power Bi and would appreciate assisstance on the following:

 

I am trying to work out the difference between planned and actual time.

As you can see in image below :

  • SECOND ROW = 40 minutes
  • FIRST ROW = -15 minutes

POWER BI COMM.PNG

My issue is with the first row. Due to it being a negative, it comes up as 'error'.

I don't need it to show the negative symbol but difference in HH:MM format

The table above is one a I created on Power Bi desktop

 

Is there a way I can work around this?

 

Note: I do have excel sheet that shows exactly what I need however when I upload, all formulas mess up. Can I keep my formulas?

 

Thanks Heaps!

2 ACCEPTED SOLUTIONS
v-lili6-msft
Community Support
Community Support

hi @Nella 

For your case, I would suggst you add a calculate column by dax as below

Difference=FORMAT([Arrived]-[Planned],"HH:MM")

https://docs.microsoft.com/en-us/dax/custom-date-and-time-formats-for-the-format-function

 

Regards,

Lin

Community Support Team _ Lin
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

2 REPLIES 2
v-lili6-msft
Community Support
Community Support

hi @Nella 

For your case, I would suggst you add a calculate column by dax as below

Difference=FORMAT([Arrived]-[Planned],"HH:MM")

https://docs.microsoft.com/en-us/dax/custom-date-and-time-formats-for-the-format-function

 

Regards,

Lin

Community Support Team _ Lin
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

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.