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
Abishek
Helper I
Helper I

Sum is displaying wrong after concatenating

Hi all,  I'm new to power bi, 

I have concatenated the two columns to get the data in "20:45" format by concatenating two columns(int fields). After concatenation the total is becoming either the first value or the last value of the column. Is there any way to get the sum of all the rows as column total?

Abishek_1-1664268245111.png

required output : the highlighted row should be the sum of all rows. that is (0:21+0:37+9:4+1.52+0.8) = 12.3

can someone help me. Thanks in advance


Measure : 
concat =

CALCULATE(CONCATENATE(SUM([Hours]),

CONCATENATE(":", SUM([Minutes]))

1 ACCEPTED SOLUTION
MFelix
Super User
Super User

Hi @Abishek ,

 

To make the calculation in hour and minutes the best option is not to concatenate the values, in this case I would convert your hours and minutes to a single value in minutes and then using a measure similar to the one on the post below make the format, this will work for the line values and the aggregated values:

 

https://community.powerbi.com/t5/Community-Blog/Aggregating-Duration-Time/ba-p/22486


Regards

Miguel Félix


Did I answer your question? Mark my post as a solution!

Proud to be a Super User!

Check out my blog: Power BI em Português



View solution in original post

2 REPLIES 2
MFelix
Super User
Super User

Hi @Abishek ,

 

To make the calculation in hour and minutes the best option is not to concatenate the values, in this case I would convert your hours and minutes to a single value in minutes and then using a measure similar to the one on the post below make the format, this will work for the line values and the aggregated values:

 

https://community.powerbi.com/t5/Community-Blog/Aggregating-Duration-Time/ba-p/22486


Regards

Miguel Félix


Did I answer your question? Mark my post as a solution!

Proud to be a Super User!

Check out my blog: Power BI em Português



Thank You @MFelix ,
 
 It works as expected. 

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.