cancel
Showing results for 
Search instead for 
Did you mean: 

Fabric is Generally Available. Browse Fabric Presentations. Work towards your Fabric certification with the Cloud Skills Challenge.

Reply
sirros_iot
Helper IV
Helper IV

Convert time to seconds

Hello all!

I have a column in the hour format( HH:mm: ss), and I want to show the average of this column, but, I'm connected by DirectQuery, so, no data modeling.

I would like to solve this issue using  just one measure, but I'm having problems with this time format, I can't even convert it into seconds.

Any idea?
Thanks

1 ACCEPTED SOLUTION
Zubair_Muhammad
Community Champion
Community Champion

@sirros_iot

 

Give this a shot

 

Seconds_Measure =
VAR myvalue =
    SELECTEDVALUE ( Table1[Column] )
RETURN
    ( myvalue - TRUNC ( myvalue ) )
        * 86400

Regards
Zubair

Please try my custom visuals

View solution in original post

3 REPLIES 3
Zubair_Muhammad
Community Champion
Community Champion

@sirros_iot

 

Give this a shot

 

Seconds_Measure =
VAR myvalue =
    SELECTEDVALUE ( Table1[Column] )
RETURN
    ( myvalue - TRUNC ( myvalue ) )
        * 86400

Regards
Zubair

Please try my custom visuals

Hello, Can you explain this formula a bit more to me?

 

The "myvalue" is that part of the formula or some custom information that has to be entered?

Thanks @Zubair_Muhammad! It did work!

Best Regards,
Diego

Helpful resources

Announcements
PBI November 2023 Update Carousel

Power BI Monthly Update - November 2023

Check out the November 2023 Power BI update to learn about new features.

Community News

Fabric Community News unified experience

Read the latest Fabric Community announcements, including updates on Power BI, Synapse, Data Factory and Data Activator.

Power BI Fabric Summit Carousel

The largest Power BI and Fabric virtual conference

130+ sessions, 130+ speakers, Product managers, MVPs, and experts. All about Power BI and Fabric. Attend online or watch the recordings.

Top Solution Authors
Top Kudoed Authors