Join us for an expert-led overview of the tools and concepts you'll need to pass exam PL-300. The first session starts on June 11th. See you there!
Get registeredPower BI is turning 10! Let’s celebrate together with dataviz contests, interactive sessions, and giveaways. Register now.
Hola
Tengo una mesa que se ve así
IDENTIFICACIÓN | Empezar | Fin | Valor |
1 | 08:00 | 08:30 | Valor1 |
2 | 08:31 | 08:33 | Valor2 |
Me gustaría cortarlos a valores individuales como
ID2 | HORA | Valor |
1 | 08:00 | Valor1 |
2 | 08:01 | Valor1 |
3 | 08:02 | Valor1 |
... |
| |
X | 08:30 | Valor1 |
x1 | 08:31 | Valor2 |
x2 | 08:32 | Valor2 |
x4 | 08:33 | Valor2 |
No tengo ni idea de cómo hacerlo. -> así que necesito ayuda
mis valores son valores de producción como la velocidad, etc. y la fecha y hora va en turnos desde DAY1 06:00 -> DAY2 06:00, por lo que un horario (como datetable común) no es una opción, creo que
BR
Romano
Solved! Go to Solution.
Pruebe esto en Power Query:
List.Times([Begin], Duration.Minutes([End] - [Begin]) + 1, #duration(0, 0, 1, 0))
Consulta completa:
let
Source = Table.FromRows(
Json.Document(
Binary.Decompress(
Binary.FromText("i45WMlTSUbKwMjAAU8YgyhDIidWJVjKCCEEUGBsDKSOQTCwA", BinaryEncoding.Base64),
Compression.Deflate
)
),
let
_t = ((type nullable text) meta [Serialized.Text = true])
in
type table [ID = _t, Begin = _t, End = _t, Value = _t]
),
ChangeType = Table.TransformColumnTypes(
Source,
{{"ID", Int64.Type}, {"Begin", type time}, {"End", type time}, {"Value", Int64.Type}}
),
AddColumn = Table.AddColumn(
ChangeType,
"Time",
each List.Times([Begin], Duration.Minutes([End] - [Begin]) + 1, #duration(0, 0, 1, 0))
),
ExpandColumn = Table.ExpandListColumn(AddColumn, "Time"),
RemoveColumns = Table.RemoveColumns(ExpandColumn,{"Begin", "End"}),
ChangeTypeTime = Table.TransformColumnTypes(RemoveColumns,{{"Time", type time}})
in
ChangeTypeTime
Pruebe esto en Power Query:
List.Times([Begin], Duration.Minutes([End] - [Begin]) + 1, #duration(0, 0, 1, 0))
Consulta completa:
let
Source = Table.FromRows(
Json.Document(
Binary.Decompress(
Binary.FromText("i45WMlTSUbKwMjAAU8YgyhDIidWJVjKCCEEUGBsDKSOQTCwA", BinaryEncoding.Base64),
Compression.Deflate
)
),
let
_t = ((type nullable text) meta [Serialized.Text = true])
in
type table [ID = _t, Begin = _t, End = _t, Value = _t]
),
ChangeType = Table.TransformColumnTypes(
Source,
{{"ID", Int64.Type}, {"Begin", type time}, {"End", type time}, {"Value", Int64.Type}}
),
AddColumn = Table.AddColumn(
ChangeType,
"Time",
each List.Times([Begin], Duration.Minutes([End] - [Begin]) + 1, #duration(0, 0, 1, 0))
),
ExpandColumn = Table.ExpandListColumn(AddColumn, "Time"),
RemoveColumns = Table.RemoveColumns(ExpandColumn,{"Begin", "End"}),
ChangeTypeTime = Table.TransformColumnTypes(RemoveColumns,{{"Time", type time}})
in
ChangeTypeTime