This time we’re going bigger than ever. Fabric, Power BI, SQL, AI and more. We're covering it all. You won't want to miss it.
Learn moreGet Fabric Certified for FREE during AI Skills Fest. This week only. Secure your voucher now.
¡Hola! Al importar una tabla de postgresql en powerBI, hay una columna que es JSON. Esta columna trata sobre la hora de inicio y finalización de la llamada para cada consulta. Los ejemplos son los siguientes:
call_start_end_times
| {"call_1": {"end_time": "21/01/2023, 07:44:11", "start_time": "21/01/2023, 07:39:16"}} |
{"call_1": {"end_time": "20/01/2023, 07:59:31", "start_time": "20/01/2023, 07:58:23"}, "call_2": {"end_time": "20/01/2023, 08:31:19", "start_time": "20/01/2023, 08:30:53"}, "call_3": {"end_time": "20/01/2023, 09:09:58", "start_time": "20/01/2023, 09:08:41"}} |
{}
Así que para algunas consultas, tienen 1 llamada, algunos tienen 2 llamadas, algunos tienen 3 llamadas, algunos tienen 0 llamadas, ... etc. Cuando agrego una nueva columna personalizada usando
"Custom", cada Json.Document([call_start_end_times])
A continuación, la nueva columna se convierte en registro.
cuando expando esta columna, la sintaxis muestra = Table.ExpandRecordColumn(#"Added Custom", "Custom", {"call_1"}, {"Custom.call_1"})
No se mostró ningún otro dato o columna. solo se muestra cuando es {}.
Por favor, hágame saber cómo expandir esta columna, ya que algunos tienen 0 llamadas, algunos tienen 1 llamada, algunos tienen 2 llamadas ... Creo que necesito modificar la sintaxis pero en power query no puedo cargar todos los registros y solo mostró {} registros. ¿Podría guiarme cómo modificar la sintaxis, para que los registros que tienen 1 llamadas, 2 llamadas, 3 llamadas, etc. se puedan expandir?
Me gustaría sugerirle que convierta el resultado de la función Json.Document en tabla primero antes de expandir las columnas.
Consulta completa:
let
Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("jZC7DsIwDEV/pfIcCTsPSO6vNFVVQQekwgDZUP+9LgzAAI3k5crH50puW3pkOg7T1EsmNBrG66kv58u4xkwsO6vD1pmGD/AeoqDRzb0Mt/KbdAmyzzTP1JmaEn6fhgT3p+STjLBOS1b06bfb/qhySKrwK8kIX3637U/QCbHCr2SEl9eTugU=", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [JsonData = _t]),
#"Changed Type" = Table.TransformColumnTypes(Source,{{"JsonData", type text}}),
#"Added Custom" = Table.AddColumn(#"Changed Type", "Custom", each Record.ToTable(Json.Document([JsonData]))),
#"Expanded Custom" = Table.ExpandTableColumn(#"Added Custom", "Custom", {"Name", "Value"}, {"Name", "Value"}),
#"Expanded Value" = Table.ExpandRecordColumn(#"Expanded Custom", "Value", {"end_time", "start_time"}, {"end_time", "start_time"})
in
#"Expanded Value"
Resultado:
Saludos
Xiaoxin Sheng
Check out the May 2026 Power BI update to learn about new features.
Sign up to receive a private message when registration opens and key events begin.
If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.