Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and a 50 percent discount on exams.
Get startedEarn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.
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")
User | Count |
---|---|
91 | |
74 | |
67 | |
63 | |
55 |
User | Count |
---|---|
99 | |
88 | |
72 | |
60 | |
59 |