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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
MikelPC
Frequent Visitor

Sum of hours in a donut chart

Hello,

 

I have for diferent tasks, the dedicated time in hours as shown in the left matrix of the below picture, and in total, I have:

  • Preventiu:  6:30 
  • Correctiu:  0:30
  • Reparacio: 1:00

The problem is that when I create the donut chart, only make the counting of hours, and not the sum as I need, is also not an option on "Values Options", so the chart shows:

  • Preventiu:  6 
  • Correctiu:  1
  • Reparacio: 1

Will be appreciated a solution. Thank you!

 

 time.jpg

1 ACCEPTED SOLUTION
BILASolution
Solution Specialist
Solution Specialist

Hi @MikelPC

 

As an alternative, I propose this...

 

1. Create 2 calculated columns

 

resultado.png

 

Duracion = Table1[Hora_Fin] - Table1[Hora_Inicio] 
Duracion Minutos = HOUR(Table1[Duracion]) * 60 + MINUTE(Table1[Duracion])

2. Create a new measure

 

Total Duracion Minutos = SUM(Table1[Duracion Minutos])

3. Finally, create a new measure with details of time.

 

Duracion FTiempo = HOUR(SUM(Table1[Duracion])) & ":" & IF(MINUTE(SUM(Table1[Duracion]))<10 ; "0" & MINUTE(SUM(Table1[Duracion]));MINUTE(SUM(Table1[Duracion]))) 

rr.png

 

NOTE: Put "Duracion FTiempo" as a Tooltip

 

I hope this helps.

 

Regards

BILASolution

View solution in original post

3 REPLIES 3
BILASolution
Solution Specialist
Solution Specialist

Hi @MikelPC

 

As an alternative, I propose this...

 

1. Create 2 calculated columns

 

resultado.png

 

Duracion = Table1[Hora_Fin] - Table1[Hora_Inicio] 
Duracion Minutos = HOUR(Table1[Duracion]) * 60 + MINUTE(Table1[Duracion])

2. Create a new measure

 

Total Duracion Minutos = SUM(Table1[Duracion Minutos])

3. Finally, create a new measure with details of time.

 

Duracion FTiempo = HOUR(SUM(Table1[Duracion])) & ":" & IF(MINUTE(SUM(Table1[Duracion]))<10 ; "0" & MINUTE(SUM(Table1[Duracion]));MINUTE(SUM(Table1[Duracion]))) 

rr.png

 

NOTE: Put "Duracion FTiempo" as a Tooltip

 

I hope this helps.

 

Regards

BILASolution

Thank you!!

Your proposal solved totally my question.

Anonymous
Not applicable

Not by my computer to put a screenshot up, however on the pane where you drop what values you want in the donut chat. On the small arrow (might be 3 dots) you should be able to change from count to sum. Alternately, make a measure for the sum and drop that in

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.