cancel
Showing results for 
Search instead for 
Did you mean: 

Fabric is Generally Available. Browse Fabric Presentations. Work towards your Fabric certification with the Cloud Skills Challenge.

Reply
walnei
Helper III
Helper III

TIME WITH MORE THAN 24 HOURS

Could you help me with a DAX formula for the sum of time that goes by 24h. According to the sample print, in my example, when I try to calculate the TOTAL TIME and TOTALTIME * COUNT columns, I have the return according to line 1 when the right one would be the result of line 2

 

Sem título3.png

5 REPLIES 5
Anonymous
Not applicable

DAX Mode ( In this mode you can agregate for any dimension)

 

QtSegundos = SUM([Seconds])

 

Time=
VAR Horas = INT([QtSegundos]/3600)
VAR Minutos = INT(([QtSegundos] - (Horas * 3600))/60)
VAR Segundos = MOD([QtSegundos];60)
RETURN
Horas&":"&FORMAT(Minutos;"00")&":"&FORMAT(Segundos;"00")
Anonymous
Not applicable

I'm assuming you're talking about "durations", or an amount of time, rather than a time of day. Try setting your data types to duration, and then you can simply add them together.

 

When you load it in, you'll get decimal numbers representing days, or 24-hour increments. You can then make measures accordingly to display however you want.

 

 

 

image.pngimage.pngimage.pngimage.png

I'll try that, and let me know if it worked.

rajendran
Community Champion
Community Champion

Hi

HOUR returns the integer, so that will work here.

 

Hour.PNG

 

Hour1.PNG

 

 

Hope this helps.

 

Thanks

Raj

 

@rajendran

Thank you for your help. But the whole hours were just an example, to illustrate the scenario. But I also have minutes and seconds, for example: 11:24:35

Helpful resources

Announcements
PBI November 2023 Update Carousel

Power BI Monthly Update - November 2023

Check out the November 2023 Power BI update to learn about new features.

Community News

Fabric Community News unified experience

Read the latest Fabric Community announcements, including updates on Power BI, Synapse, Data Factory and Data Activator.

Dashboard in a day with date

Exclusive opportunity for Women!

Join us for a free, hands-on Microsoft workshop led by women trainers for women where you will learn how to build a Dashboard in a Day!

Power BI Fabric Summit Carousel

The largest Power BI and Fabric virtual conference

130+ sessions, 130+ speakers, Product managers, MVPs, and experts. All about Power BI and Fabric. Attend online or watch the recordings.

Top Solution Authors
Top Kudoed Authors