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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now

Reply
jernbanen
New Member

DAX calculation.

I have a report created from different data tables showing train traffic data like this. I need help for 2 issues: 1) How do I make the arrive_delay column to show times as hh:mm:ss instead of as decimal numbers. 2) I need a calculation or a measure that shows in % how many of each days total counted arrives are more than 3:00 minutes delayed and a calculation of the average delay of these delayed arrivals.

 

Can anyone help me making these calculations or measures?

 

27-01-2019 12.38 Office Lens.jpeg

1 ACCEPTED SOLUTION
Greg_Deckler
Community Champion
Community Champion

For the first one, there is a blog article here:

https://community.powerbi.com/t5/Community-Blog/Aggregating-Duration-Time/ba-p/22486

 

And a quick measure:

https://community.powerbi.com/t5/Quick-Measures-Gallery/Seconds-2-HHMMSS/m-p/195615

 

For the second one, you are going to need the reverse, convert your hhmmss times to seconds probably.

https://community.powerbi.com/t5/Quick-Measures-Gallery/Duration-to-Seconds-Converter/m-p/342279



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...

View solution in original post

2 REPLIES 2
ryan_mayu
Super User
Super User

@jernbanen

 

For the first issue, you just need to change the format. No matter you create a column or measure.

 

differnce = Sheet1[real]-Sheet1[schedule]

c1.JPG

 

 

difference2 = sum(Sheet1[real])-SUM(Sheet1[schedule])

Capture.JPG

 

for the second issue,you can try below coding

count% = 
DIVIDE( CALCULATE(COUNT(Sheet1[schedule]),FILTER(Sheet1,Sheet1[differnce]*86400>180)),COUNT(Sheet1[schedule]))

c.JPG

 





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




Greg_Deckler
Community Champion
Community Champion

For the first one, there is a blog article here:

https://community.powerbi.com/t5/Community-Blog/Aggregating-Duration-Time/ba-p/22486

 

And a quick measure:

https://community.powerbi.com/t5/Quick-Measures-Gallery/Seconds-2-HHMMSS/m-p/195615

 

For the second one, you are going to need the reverse, convert your hhmmss times to seconds probably.

https://community.powerbi.com/t5/Quick-Measures-Gallery/Duration-to-Seconds-Converter/m-p/342279



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
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