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

Prepping for a Fabric certification exam? Join us for a live prep session with exam experts to learn how to pass the exam. Register now.

Reply
Anonymous
Not applicable

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 @Anonymous 

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 @Anonymous 

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
PBIApril_Carousel

Power BI Monthly Update - April 2025

Check out the April 2025 Power BI update to learn about new features.

Notebook Gallery Carousel1

NEW! Community Notebooks Gallery

Explore and share Fabric Notebooks to boost Power BI insights in the new community notebooks gallery.

April2025 Carousel

Fabric Community Update - April 2025

Find out what's new and trending in the Fabric community.