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
Anonymous
Not applicable

24 HR Time Conversion - Data Fact Checking

Greetings Power BI Ninjas!

 

Your expertise is needed. I have a calculated column, RuntimeHours, which convered seconds to hours. I also have a date table with connected relationship.

 

PROBLEM: I am struggling to get my data to be correct. From the sample screenshot below, RuntimeHours are > 24hrs. We obviously know that this is incorrect because there are only 24 hours in a day.

 

SOLUTION NEEDED: Help to get the runtime hours to calculate true to the date references:

- Day = 24hrs or less

- Month = 730hrs or less

- Quarter = 2190hrs or less

- Year = 8760hrs or less

 

FYI, the Calendar table references are as follows:

 

- DayInMonth = DAY('Calendar'[Date]) -> WHOLE NUMBER data type

- Month = FORMAT('Calendar'[Date], "MMM") -> TEXT data type

- FiscalQuarterNumber = (IF ('Calendar'[CalendarMonthNumber] < 4, 4, 'Calendar'[QuarterNumber] -1)) -> WHOLE NUMBER data type

- FiscalYear = IF('Calendar'[CalendarMonthNumber] < 4, 'Calendar'[Year] -1, 'Calendar'[Year]) -> WHOLE NUMBER data type

 

FYI, the RuntimeHours reference are as follows:

 

-  RuntimeHours = (([RuntimeSeconds] / 60) / 60) -> Decimal Number -> meaning 812seconds = 0.23 hours

 

Any assistance to get this data correct will be greatly appreciated! THANK YOU!!

 

24hrCalculation.png

3 REPLIES 3
AlB
Super User
Super User

Hi @Anonymous

Where is the seconds value you want to convert to hours? What is the code for [RuntimeSeconds]? Is it a measure or a column?

Is 'RuntimeHours' supposed to be a measure? If so, where and how will you use it?

 

Anonymous
Not applicable

@AlB Thank you for your response. RuntimeSeconds is the raw data so it is a column and I created a calculated column to convert the seconds to hours (RuntimeHours). RuntimeHours was created as a calculated column.

 

I am not sure on how to create RuntmeHours as a measure. The current calculated column is as follows

 

RuntimeHours = (([RuntimeSeconds] / 60), 60)

 

Any ideas on how I should proceed?

@Anonymous,

 

Make sure the data in [RuntimeSeconds] are correct. You may use DAX Studio to capture queries.

Community Support Team _ Sam Zha
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

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.