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

The ultimate Microsoft Fabric, Power BI, Azure AI & SQL learning event! Join us in Las Vegas from March 26-28, 2024. Use code MSCUST for a $100 discount. Register Now

Reply
Anonymous
Not applicable

calcaute total hours

Hi,
 
im trying to calcuate total hours of the duration which is HH:MM:SS format in excel, i changedthe type to duration in power query applied following DAX, but couldnt get the result. please help I'm a beginner to PBI
 
Total Hrs = CALCULATE(SUMX(BWay_Data,BWay_Data[Time Duration of the call]),BWay_Data[Lead Status])
1 ACCEPTED SOLUTION

Hi @Anonymous ,

 

It is beacause that in Power Query Editor, there are two data types not currently present in Data or Report View: Date/Time/Timezone and Duration.

When a column with these data types is loaded into the model and viewed in Data or Report view, a column with a Date/Time/Timezone data type will be converted into a Date/Time, and a column with a Duration data type is converted into a Decimal Number, such as 0.00:00:00 (D.HH:MM:SS).

You'll likely need to write a measure to format exactly how you want.

Sample data: 0.18:01:00

Measure:

Measure = FORMAT(MAX('Table'[Column1]),"hh:nn:ss")

vxiaosunmsft_4-1669280029997.png

 

Or you can use the following formula to create a custom column in Power Query to return the total hours.

= Duration.TotalHours([Column1])

vxiaosunmsft_2-1669279851645.png

vxiaosunmsft_3-1669279876308.png

 

Best Regards,
Community Support Team _ xiaosun

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

3 REPLIES 3
Anonymous
Not applicable

Pls find below

 

RazikM_1-1669015943136.png

RazikM_2-1669016021785.png

 

Hi @Anonymous ,

 

It is beacause that in Power Query Editor, there are two data types not currently present in Data or Report View: Date/Time/Timezone and Duration.

When a column with these data types is loaded into the model and viewed in Data or Report view, a column with a Date/Time/Timezone data type will be converted into a Date/Time, and a column with a Duration data type is converted into a Decimal Number, such as 0.00:00:00 (D.HH:MM:SS).

You'll likely need to write a measure to format exactly how you want.

Sample data: 0.18:01:00

Measure:

Measure = FORMAT(MAX('Table'[Column1]),"hh:nn:ss")

vxiaosunmsft_4-1669280029997.png

 

Or you can use the following formula to create a custom column in Power Query to return the total hours.

= Duration.TotalHours([Column1])

vxiaosunmsft_2-1669279851645.png

vxiaosunmsft_3-1669279876308.png

 

Best Regards,
Community Support Team _ xiaosun

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

FreemanZ
Super User
Super User

can you show the PQ-processed table?

Helpful resources

Announcements
Fabric Community Conference

Microsoft Fabric Community Conference

Join us at our first-ever Microsoft Fabric Community Conference, March 26-28, 2024 in Las Vegas with 100+ sessions by community experts and Microsoft engineering.

February 2024 Update Carousel

Power BI Monthly Update - February 2024

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

Fabric Career Hub

Microsoft Fabric Career Hub

Explore career paths and learn resources in Fabric.

Fabric Partner Community

Microsoft Fabric Partner Community

Engage with the Fabric engineering team, hear of product updates, business opportunities, and resources in the Fabric Partner Community.

Top Solution Authors