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

Learn from the best! Meet the four finalists headed to the FINALS of the Power BI Dataviz World Championships! Register now

Reply
Steve_luck22
New Member

Problem Calculating Date Diff from Date formatted DD/MM/YYYY HH:MM

Hi Everyone, i have a problem that i just cant seem to solve and im certain there is a simple alternative out there. I have a column (Example below) that has a cell formatted DD/MM/YYYY Hours:Minutes and i am trying to create a counter that breaks the days left into a format below, i can do it easily on Excel but trying to convert it to Power BI is a struggle. 

 

I have used the Date Diff to calculate the difference in days, but i cant seem to bring it into one column? and include both hours, minutes and days. Any help would be greatly appreciated. 

 
Target Completion Date      Target Completion date in days & Hours

 

21/02/2023 08:15                 -1 Days 15 Hours 50 Minutes

2 REPLIES 2
Steve_luck22
New Member

Hi Mark, 

 

Data example and output below, i have achieved it on Excel with the following but struggling with the Power BI query. i basically want to compare the Target Completion Date with TODAY() or NOW() to get an output in a format below

 

=INT(J2-NOW())&" Days "&HOUR(MOD(J2-$N$1,1))&" Hours "&MINUTE(MOD(J2-$N$1,1))&" minutes "

 

Target Completion Date Target Completion Date in days
21/02/2023 08:15 -1 Days 15 Hours 16 minutes
21/02/2023 09:04 -1 Days 16 Hours 6 minutes
21/02/2023 07:54 -1 Days 14 Hours 56 minutes
21/02/2023 15:07 -1 Days 22 Hours 9 minutes

Greg_Deckler
Community Champion
Community Champion

@Steve_luck22 Sorry, having trouble following, can you post sample data as text and expected output?
Not really enough information to go on, please first check if your issue is a common issue listed here: https://community.powerbi.com/t5/Community-Blog/Before-You-Post-Read-This/ba-p/1116882

Also, please see this post regarding How to Get Your Question Answered Quickly: https://community.powerbi.com/t5/Community-Blog/How-to-Get-Your-Question-Answered-Quickly/ba-p/38490

The most important parts are:
1. Sample data as text, use the table tool in the editing bar
2. Expected output from sample data
3. Explanation in words of how to get from 1. to 2.



Follow on LinkedIn
@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
DAX For Humans

DAX is easy, CALCULATE makes DAX hard...

Helpful resources

Announcements
Join our Fabric User Panel

Join our Fabric User Panel

Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.

February Power BI Update Carousel

Power BI Monthly Update - February 2026

Check out the February 2026 Power BI update to learn about new features.

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.