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

Formato del valor de tiempo

¡Hola a todos!

Estoy buscando una manera de convertir número entero a formato de tiempo como este:

900-9:00

0-0:00

1 ACCEPTED SOLUTION
edhans
Super User
Super User

Si desea usar Power Query, esto lo hará.

Time.From(
 Text.From(
  Number.IntegerDivide([Column1],100)
  ) 
 & ":" & 
 Text.End(
  Text.From([Column1]),
  2)
 )

Se convertirá a un tiempo legítimo de 9am suponiendo que 900 es el entero en la Columna1

Lo siguiente en DAX funcionará en una columna calculada.

Column =
TIME( ROUND(
    [Column1] / 100,
    0
), VALUE(
    RIGHT(
        FORMAT(
            [Column1],
            "#"
        ),
        2
    )
), 0 )

Ninguna de estas soluciones asume que los dos últimos dígitos son siempre 00. Así que 945 se convertiría a 9:45 ambas veces.



Did I answer your question? Mark my post as a solution!
Did my answers help arrive at a solution? Give it a kudos by clicking the Thumbs Up!

DAX is for Analysis. Power Query is for Data Modeling


Proud to be a Super User!

MCSA: BI Reporting

View solution in original post

3 REPLIES 3
Anonymous
Not applicable

¡¡¡Muchas gracias!!!

amitchandak
Super User
Super User

@MuSul ,

nueva columna: time(quotient([column],100),mod([colum],100),0)

edhans
Super User
Super User

Si desea usar Power Query, esto lo hará.

Time.From(
 Text.From(
  Number.IntegerDivide([Column1],100)
  ) 
 & ":" & 
 Text.End(
  Text.From([Column1]),
  2)
 )

Se convertirá a un tiempo legítimo de 9am suponiendo que 900 es el entero en la Columna1

Lo siguiente en DAX funcionará en una columna calculada.

Column =
TIME( ROUND(
    [Column1] / 100,
    0
), VALUE(
    RIGHT(
        FORMAT(
            [Column1],
            "#"
        ),
        2
    )
), 0 )

Ninguna de estas soluciones asume que los dos últimos dígitos son siempre 00. Así que 945 se convertiría a 9:45 ambas veces.



Did I answer your question? Mark my post as a solution!
Did my answers help arrive at a solution? Give it a kudos by clicking the Thumbs Up!

DAX is for Analysis. Power Query is for Data Modeling


Proud to be a Super User!

MCSA: BI Reporting

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.