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.
hola
Necesito crear una nueva columna que ponga una hora en un intervalo de tiempo
Los intervalos de tiempo están en franjas horarias
00:00-01:00 |
01:00-02:00 |
02:00-03:00 |
03:00-04:00 |
04:00-05:00 |
05:00-06:00 |
Mi conjunto de datos de ejemplo tiene este aspecto
Hora |
00:02:10 |
09:45:56 |
06:33:53 |
00:00:20 |
00:01:42 |
El resultado esperado con la nueva columna tendría este aspecto:
Hora | Intervalo de tiempo |
00:02:10 | 00:00-01:00 |
09:45:56 | 09:00-10:00 |
06:33:53 | 06:00-07:00 |
00:00:20 | 00:00-01:00 |
00:01:42 | 00:00-01:00 |
Cualquier ayuda sería muy apreciada
Gracias de antemano
Solved! Go to Solution.
No @KG1
Puede crear una columna con el siguiente código:-
Time_Bracket =
VAR start_hour =
FORMAT ( Time_Bucket[Time], "hh" )
VAR end_hour =
IF ( LEN ( start_hour + 1 ) = 1, "0" & start_hour + 1, start_hour + 1 )
RETURN
start_hour & ":00 - " & end_hour & ":00"
gracias
Samarth
Había algunas filas en blanco al final del conjunto de datos: las he eliminado y ha funcionado perfectamente
Muchas gracias por su ayuda
No @KG1
Puede crear una columna con el siguiente código:-
Time_Bracket =
VAR start_hour =
FORMAT ( Time_Bucket[Time], "hh" )
VAR end_hour =
IF ( LEN ( start_hour + 1 ) = 1, "0" & start_hour + 1, start_hour + 1 )
RETURN
start_hour & ":00 - " & end_hour & ":00"
gracias
Samarth
Gracias por responder, pero recibo el siguiente error
No se puede convertir el valor '' de tipo Text al tipo Number.
¿Podría por favor hágamelo saber el tipo de datos de su columna de tiempo?
Había algunas filas en blanco al final del conjunto de datos: las he eliminado y ha funcionado perfectamente
Muchas gracias por su ayuda
Si desea mantener esas filas de espacios en blanco, puede consultar el siguiente código:-
Time_Bracket =
VAR start_hour =
FORMAT ( Time_Bucket[Time], "hh" )
VAR end_hour =
IF ( LEN ( start_hour + 1 ) = 1, "0" & start_hour + 1, start_hour + 1 )
VAR result = start_hour & ":00 - " & end_hour & ":00"
RETURN
IF ( NOT ( ISBLANK ( Time_Bucket[Time] ) ), result, BLANK () )
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
1 | |
1 | |
1 | |
1 | |
1 |