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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
uie07923
Frequent Visitor

Compensatory Hours Conversion

Hello,

 

I have a report of compensatory hours. It can bring results in Positive or Negative number of hours.

 

In the original file, the negative hours have the "-" after the number, eg: 00001:00-

When importing it in Power Query, the positive hours are automatically converted to fraction of a day.

The negative hours, remain in the original format.

 

I need to convert everything into number of hours, negative and positive. They can be in the decimal format, eg: 1,5 would be equivalent to 36:00.

 

horas BI.png

 

Sample file:

https://drive.google.com/file/d/102S7DITbFnXMJhHOPMx--wXfRV2lxaEi/view?usp=sharing

1 ACCEPTED SOLUTION
v-pnaroju-msft
Community Support
Community Support

Thankyou, @lbendlin ,for your response.

Hi uie07923,

We appreciate your query on the Microsoft Fabric Community Forum.

Based on my understanding, please follow the high-level steps mentioned below to help resolve the issue and standardize the time format:

  1. Open the Power Query Editor in Power BI.

  2. Add a custom column to identify and handle both positive and negative time formats.

  3. Remove the trailing hyphen from negative values and convert all time entries to decimal hours.

  4. Reapply the negative sign to ensure accurate results.

  5. This approach ensures a single, clean column with time values in a consistent decimal format.

For example, this process will convert entries such as 01:30 to 1.5 and 00002:00- to -2.
These standardized values can now be directly used in calculations, visuals, or DAX measures.

If you find our response helpful, kindly mark it as the accepted solution and consider giving kudos. This will benefit other community members who may have similar queries.

Thank you.

View solution in original post

4 REPLIES 4
v-pnaroju-msft
Community Support
Community Support

Hi uie07923,

We wanted to check in regarding your query, as we have not heard back from you. If you have resolved the issue, sharing the solution with the community would be greatly appreciated and could help others encountering similar challenges.

If you found our response useful, kindly mark it as the accepted solution and provide kudos to guide other members.

Thank you.

v-pnaroju-msft
Community Support
Community Support

Hi uie07923,

We have not received a response from you regarding the query and were following up to check if you have found a resolution. If you have identified a solution, we kindly request you to share it with the community, as it may be helpful to others facing a similar issue.

If you find the response helpful, please mark it as the accepted solution and provide kudos, as this will help other members with similar queries.

Thank you.

v-pnaroju-msft
Community Support
Community Support

Thankyou, @lbendlin ,for your response.

Hi uie07923,

We appreciate your query on the Microsoft Fabric Community Forum.

Based on my understanding, please follow the high-level steps mentioned below to help resolve the issue and standardize the time format:

  1. Open the Power Query Editor in Power BI.

  2. Add a custom column to identify and handle both positive and negative time formats.

  3. Remove the trailing hyphen from negative values and convert all time entries to decimal hours.

  4. Reapply the negative sign to ensure accurate results.

  5. This approach ensures a single, clean column with time values in a consistent decimal format.

For example, this process will convert entries such as 01:30 to 1.5 and 00002:00- to -2.
These standardized values can now be directly used in calculations, visuals, or DAX measures.

If you find our response helpful, kindly mark it as the accepted solution and consider giving kudos. This will benefit other community members who may have similar queries.

Thank you.

lbendlin
Super User
Super User

Your data is inconsistent. Can the "Personalizar"  column be ignored?

 

lbendlin_0-1741287118352.png

 

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.