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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply
ERing
Post Partisan
Post Partisan

Is it possible to dynamically time duration in minutes if greater than 60 seconds?

I have a requirement to display web site visit duration. What I'm struggling with is how I can show the result so that if  Average_Visit_Time <=60 seconds then show "00 SEC" but if Average_Visit_Time is >=61 seconds then show "00:00 MIN:SEC".

My measure and samle data is below.

 

Average_Visit_Time = AVERAGE(TABLE [VISIT_DURATION_SECONDS])
 
Visit_IDVisit_DateVISIT_DURATION_SECONDS
110/2/221130
210/1/221453
310/2/22433
410/4/22434
510/3/221130
610/3/221397
710/3/22107
810/2/221054
910/5/221388
1010/1/22250
1110/5/22748
1210/4/221213
1310/1/221417
1410/3/221441
1510/4/22650
1610/1/221106
1710/1/22750
1810/4/221470
1910/3/22565
2010/1/221144
2110/3/221239
2210/3/22430
2310/2/221435
2410/5/221400
2510/1/22557
2610/3/22955
2710/4/22632
2810/4/22419
2910/4/22732
3010/5/2251
1 ACCEPTED SOLUTION
vicky_
Super User
Super User

Here's something to get you started: 

Measure = 
var TotalSeconds = AVERAGE('Table'[VISIT_DURATION_SECONDS])
var TotalMins = QUOTIENT(TotalSeconds, 60)
var remainderSeconds = MOD(TotalSeconds, 60)
return IF(TotalSeconds > 60, FORMAT(TotalMins, "##########") & ":" & FORMAT(remainderSeconds, "00"), TotalSeconds & " seconds")

View solution in original post

1 REPLY 1
vicky_
Super User
Super User

Here's something to get you started: 

Measure = 
var TotalSeconds = AVERAGE('Table'[VISIT_DURATION_SECONDS])
var TotalMins = QUOTIENT(TotalSeconds, 60)
var remainderSeconds = MOD(TotalSeconds, 60)
return IF(TotalSeconds > 60, FORMAT(TotalMins, "##########") & ":" & FORMAT(remainderSeconds, "00"), TotalSeconds & " seconds")

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.