Join us for an expert-led overview of the tools and concepts you'll need to pass exam PL-300. The first session starts on June 11th. See you there!
Get registeredPower BI is turning 10! Let’s celebrate together with dataviz contests, interactive sessions, and giveaways. Register now.
I'm trying to calculate the sum of time using the below formula but unable to get the desired result because the dax is not able to convert 00:00:00 to 12:00:00. I even tried converting the column to the 12hr format but still unable to achieve the result.
Formula:
Login=
var TotalTime=SumX(
data,
hours(data[logintime]) + Divide(minute(data[logintime]),60) +Divide(second(data[logintime]),3600) )
var days=Divide(TotalTime,24)
var Hours=(days)*24
var HoursInt=Trunc(Hours)
var Minutes=(Hours - HoursInt)*60
var MinutesInt=Trunc(Minutes)
var Seconds=Round ((Minutes-MinutesInt)*60,0)
Return
Format(HoursInt,"00")&"h,"& Format(MinutesInt, "00")&"m,"&Format(Seconds, "00")&"s"
Hi, I want to calculate the total login time for the agents. I have a column that have login time in seconds and I've transformed the column in hh:mm:ss and now I want the sum of hours ,minutes and seconds in the format hh:mm:ss
@Akhil008
Please try
Login =
VAR TotalSeconds = 263117
VAR Seconds =
MOD ( TotalSeconds, 60 )
VAR TotalMinutes =
QUOTIENT ( TotalSeconds, 60 )
VAR Minutes =
MOD ( TotalMinutes, 60 )
VAR TotalHours =
QUOTIENT ( TotalMinutes, 60 )
VAR Hours =
MOD ( TotalHours, 24 )
VAR Days =
QUOTIENT ( TotalHours, 24 ) -- just in case required
RETURN
FORMAT ( Hours, "00" ) & "h,"
& FORMAT ( Minutes, "00" ) & "m,"
& FORMAT ( Seconds, "00" ) & "s"
Sorry did not clarify the solution. The integer in the TotalSeconds variable shall be simply replaced with sum of the time in seconds column.
This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.
Check out the June 2025 Power BI update to learn about new features.
User | Count |
---|---|
15 | |
11 | |
11 | |
10 | |
10 |
User | Count |
---|---|
19 | |
14 | |
13 | |
11 | |
8 |