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

View all the Fabric Data Days sessions on demand. View schedule

Reply
FJH2024
Frequent Visitor

Comparing times against each other and showing a negative difference (if there is one)

Hi guys,

 

Hoping someone might be able to help me with this one!

 

I have some different times I'm comparing against each other - "Time Logged", "Time Estimated" and "Time Remaining". When the Time Logged is greater than the Time Estimated, I want the Time Remaining to show a negative figure. It currently is only showing as 00:00:00:

 

FJH2024_1-1707837660426.png

 

The example highlighted shows the Time Logged as 06:30:00 and Time Estimated as 05:00:00, so ideally I'd like the Time Remaining to show -01:30:00 as it's run an hour and a half past the estimate.

 

Does anyone know if I can alter the format of the "Time Remaining" column so it will show a negative time figure if the estimate has overrun? Or is there some sort of calculation I need to run?

 

I'm pretty new to using PowerBI so still getting to grips with it, so I'm sorry if this is a really obvious question! Thanks for your help in advance 🙂 

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi @FJH2024 ,

Here some steps that I want to share, you can check them if they suitable for your requirement.

Here is my test data:

vheqmsft_0-1707877674459.png

Create a measure

Time Remaining = 
VAR _t = SELECTEDVALUE('Table'[Time Logged]) - SELECTEDVALUE('Table'[Time Estimated])
RETURN
IF(
    SELECTEDVALUE('Table'[Time Logged])>SELECTEDVALUE('Table'[Time Estimated]),
    FORMAT(_t,"-hh:mm:ss"),
    FORMAT(_t,"hh:mm:ss")
    )

Final output

vheqmsft_1-1707877716634.png

 

Best regards,

Albert He

 

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

3 REPLIES 3
Anonymous
Not applicable

Hi @FJH2024 ,

Here some steps that I want to share, you can check them if they suitable for your requirement.

Here is my test data:

vheqmsft_0-1707877674459.png

Create a measure

Time Remaining = 
VAR _t = SELECTEDVALUE('Table'[Time Logged]) - SELECTEDVALUE('Table'[Time Estimated])
RETURN
IF(
    SELECTEDVALUE('Table'[Time Logged])>SELECTEDVALUE('Table'[Time Estimated]),
    FORMAT(_t,"-hh:mm:ss"),
    FORMAT(_t,"hh:mm:ss")
    )

Final output

vheqmsft_1-1707877716634.png

 

Best regards,

Albert He

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly

Hi Albert,

 

Just another small question if that's okay. This formula worked perfectly, however do you know if there's a way to alter the formulation slightly so the new Time Remaining column shows a total at the bottom? I've tried adding the SUM() function (as Google suggested) however it's throwing an error, so wondered if you had any thoughts 🙂

 

FJH2024_0-1707992246156.png

 

Thanks for your help in advance!

Hi Albert,

 

This worked perfectly! Thank you so much for your help, I really appreciate it 🙂 

Helpful resources

Announcements
November Power BI Update Carousel

Power BI Monthly Update - November 2025

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

Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Solution Authors
Top Kudoed Authors