cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Basheer24
Frequent Visitor

Convert hours on PowerBI

Dear all,

 

I'm not an expert on PowerBI and need some help. How can I get the below formula into power BI.

 

=VALUE(LEFT(TEXT(A2,"##0.00"),FIND(".",TEXT(A2,"#0.00"))-1)*60)+VALUE(RIGHT(TEXT(A2,"#0.00"),2))

 

Basheer24_1-1626540119521.png

 

1 ACCEPTED SOLUTION
Eyelyn9
Community Support
Community Support

Hi @Basheer24 ,

 

If the column is Number type, you could use the following formula to create a column:

Column 1= 
var _Integer= INT([Contract(hh.mm)])
var _Decimal= ([Contract(hh.mm)]-_Integer) *100
return _Integer *60 + _Decimal

 Or modify your syntax to fit in PBI like this:

Column 2= 
var _s=FORMAT([Contract(hh.mm)],"##.00")
return LEFT( _s ,FIND(".",_s)-1) * 60 + RIGHT(_s,2)

The final output is shown below:

Convert hours on PowerBI.PNG

Best Regards,
Eyelyn Qin
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

2 REPLIES 2
Eyelyn9
Community Support
Community Support

Hi @Basheer24 ,

 

If the column is Number type, you could use the following formula to create a column:

Column 1= 
var _Integer= INT([Contract(hh.mm)])
var _Decimal= ([Contract(hh.mm)]-_Integer) *100
return _Integer *60 + _Decimal

 Or modify your syntax to fit in PBI like this:

Column 2= 
var _s=FORMAT([Contract(hh.mm)],"##.00")
return LEFT( _s ,FIND(".",_s)-1) * 60 + RIGHT(_s,2)

The final output is shown below:

Convert hours on PowerBI.PNG

Best Regards,
Eyelyn Qin
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

ThanksEyelyn Qin

Helpful resources

Announcements
PBI_User Group Leader_768x460.jpg

Manage your user group events

Check out the News & Announcements to learn more.

MBAS on Demand

2021 Release Wave 2 Plan

Power Platform release plan for the 2021 release wave 2 describes all new features releasing from October 2021 through March 2022.

Get Ready for Power BI Dev Camp

Microsoft named a Leader in The Forrester Wave

Microsoft received the highest score of any vendor in both the strategy and current offering categories.

R2 (Green) 768 x 460px.png

Microsoft Dynamics 365 & Power Platform User Professionals

DynamicsCon is a FREE, 4 half-day virtual learning experience for 11,000+ Microsoft Business Application users and professionals.

Top Solution Authors