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

Round Up minutes to whole Hour

Can I round up the minutes to whole hour?
This is the current formula I have.
Hours worked =
VAR _min =calculate(MIN('TNS_dbo_POS.CPI'[Time]),ALLEXCEPT('TNS_dbo_POS.CPI','TNS_dbo_POS.CPI'[BUS_DATE],'TNS_dbo_POS.CPI'[EMP_ID]))
VAR _max = CALCULATE(MAX('TNS_dbo_POS.CPI'[Time]),ALLEXCEPT('TNS_dbo_POS.CPI','TNS_dbo_POS.CPI'[BUS_DATE],'TNS_dbo_POS.CPI'[EMP_ID]))
RETURN
FORMAT(_max -_min, "h")

 

Bgonen777_0-1706889784859.png

 

1 ACCEPTED SOLUTION
aj1973
Community Champion
Community Champion

Hi @Bgonen777 

this column 'TNS_dbo_POS.CPI'[Time] contains HH:MM:SS ? if so then you need to render it all in SS then 

Hours worked = 

VAR _Hours = DIVIDE('TNS_dbo_POS.CPI'[Time_In_Seconds] ,3600)
RETURN

ROUNDUP(_Hours, 0)

 

Regards
Amine Jerbi

If I answered your question, please mark this thread as accepted
and you can follow me on
My Website, LinkedIn and Facebook

View solution in original post

1 REPLY 1
aj1973
Community Champion
Community Champion

Hi @Bgonen777 

this column 'TNS_dbo_POS.CPI'[Time] contains HH:MM:SS ? if so then you need to render it all in SS then 

Hours worked = 

VAR _Hours = DIVIDE('TNS_dbo_POS.CPI'[Time_In_Seconds] ,3600)
RETURN

ROUNDUP(_Hours, 0)

 

Regards
Amine Jerbi

If I answered your question, please mark this thread as accepted
and you can follow me on
My Website, LinkedIn and Facebook

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.