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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends September 15. Request your voucher.

Reply
Spotto
Helper IV
Helper IV

Convert an hour to a measure as a value

hello everyone, I need a measure that brings me the time extracted from a date/time field, but when I did that the result is bringing the value as text and I needed the result as a number to compare it later if it is greater or less than a value.
thank you for the help

 

Spotto_0-1648051275879.png

Time =
var horas = format(MAX('gdp tb_Pagamento_Contrato'[Data_Liberado_PGTO]),"hh")
return horas
1 ACCEPTED SOLUTION
AlexisOlson
Super User
Super User

Instead of FORMAT, you can write

 

Time = TIMEVALUE ( MAX ( Table1[DateTime] ) )

View solution in original post

1 REPLY 1
AlexisOlson
Super User
Super User

Instead of FORMAT, you can write

 

Time = TIMEVALUE ( MAX ( Table1[DateTime] ) )

Helpful resources

Announcements
August Power BI Update Carousel

Power BI Monthly Update - August 2025

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

August 2025 community update carousel

Fabric Community Update - August 2025

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