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!
¿Puede alguien ayudarme a transformar los valores de las columnas (Diferencia de fecha) que no son constantes en varias columnas como se muestra a continuación: Es una solicitud urgente de mi cliente que necesita 4 columnas exactas como salida para todos los marcos de tiempo? Gracias de antemano.
Entrada | salida | |||
Diferencia de fecha | Semana(w) | Día(d) | horas(h) | minutos(m) |
1w 5d 18h 54m | 1 | 5 | 18 | 54 |
1d 1h 3m | - | 1 | 1 | 3 |
2h 20m | - | - | 2 | 20 |
10m | - | - | - | 10 |
let
Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45WMixXME1RMLTIUDA1yVWK1QGKALkZCsYQjlGGgpEBVBxKG5UbZygoKBgZQbiWKUCOoQWQEwsA", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [#"Date difference" = _t]),
#"Split Column by Character Transition" =
Table.AddColumn(
Source,
"Split",
each let
l = List.Transform(
Splitter.SplitTextByCharacterTransition((c) => not List.Contains({"0".."9"}, c), {"0".."9"})(Text.Remove([Date difference], " ")),
Splitter.SplitTextByCharacterTransition({"0".."9"}, (c) => not List.Contains({"0".."9"}, c))
),
r = List.Zip(l)
in Record.FromList(r{0}, r{1})
),
#"Expanded Split" = Table.ExpandRecordColumn(#"Split Column by Character Transition", "Split", {"w", "d", "h", "m"})
in
#"Expanded Split"
Gracias por la rápida respuesta,
Como soy nuevo en Power BI, ¿puede dejarme los pasos para ejecutar su código (o) dónde copiar su código?
¿Puedo copiar el código en una columna personalizada? si es así, entonces estoy obteniendo valores como tabla, tabla ... en la nueva columna.
PLease guíame. gracias
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 |