Power BI is turning 10! Tune in for a special live episode on July 24 with behind-the-scenes stories, product evolution highlights, and a sneak peek at what’s in store for the future.
Save the dateEnhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.
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.
Visit_ID | Visit_Date | VISIT_DURATION_SECONDS |
1 | 10/2/22 | 1130 |
2 | 10/1/22 | 1453 |
3 | 10/2/22 | 433 |
4 | 10/4/22 | 434 |
5 | 10/3/22 | 1130 |
6 | 10/3/22 | 1397 |
7 | 10/3/22 | 107 |
8 | 10/2/22 | 1054 |
9 | 10/5/22 | 1388 |
10 | 10/1/22 | 250 |
11 | 10/5/22 | 748 |
12 | 10/4/22 | 1213 |
13 | 10/1/22 | 1417 |
14 | 10/3/22 | 1441 |
15 | 10/4/22 | 650 |
16 | 10/1/22 | 1106 |
17 | 10/1/22 | 750 |
18 | 10/4/22 | 1470 |
19 | 10/3/22 | 565 |
20 | 10/1/22 | 1144 |
21 | 10/3/22 | 1239 |
22 | 10/3/22 | 430 |
23 | 10/2/22 | 1435 |
24 | 10/5/22 | 1400 |
25 | 10/1/22 | 557 |
26 | 10/3/22 | 955 |
27 | 10/4/22 | 632 |
28 | 10/4/22 | 419 |
29 | 10/4/22 | 732 |
30 | 10/5/22 | 51 |
Solved! Go to Solution.
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")
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")
Check out the July 2025 Power BI update to learn about new features.
User | Count |
---|---|
97 | |
96 | |
58 | |
45 | |
42 |