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

Expandir una columna de Listas y Registros

  1. Tengo una columna con LISTAS y RECORDAS
  2. Dentro de cada lista hay varios registros
  3. Dentro de cada registro hay: FLTINFO, ORIGIN, DESTINATION, etc.
  4. Dentro de FLTINFO hay FLIGHT (número de vuelo)
  5. Quiero ver el número de vuelo en una columna.
2 REPLIES 2
V-lianl-msft
Community Support
Community Support

Hola @querycruncher ,

Puede consultar este subproceso para obtener más información:https://community.powerbi.com/t5/Power-Query/Difficulties-with-Expanding-columns-with-list-and-recor...

Saludos
Liang
Si este post ayuda, por favor considere Aceptarlo como la solución para ayudar a los otros miembros a encontrarlo más rápidamente.

Anonymous
Not applicable

Debo mencionar mi código actual que devuelve un error (al intentar expandir registros) es:

let
    Source = DocumentDB.Contents("https://acaze2-ai-uat-cdb-ca-fac.documents.azure.com:443/"),
    reporting = Source{[id="reporting"]}[Collections],
    reporting_live_booking = reporting{[db_id="reporting",id="live_booking"]}[Documents],
    #"Expanded Document" = Table.ExpandRecordColumn(reporting_live_booking, "Document", {"data"}, {"Document.data"}),
    #"Expanded Document.data" = Table.ExpandRecordColumn(#"Expanded Document", "Document.data", {"ESWEBSERVICE"}, {"Document.data.ESWEBSERVICE"}),
    #"Expanded Document.data.ESWEBSERVICE" = Table.ExpandRecordColumn(#"Expanded Document.data", "Document.data.ESWEBSERVICE", {"ECIBOK-OUT"}, {"Document.data.ESWEBSERVICE.ECIBOK-OUT"}),
    #"Expanded Document.data.ESWEBSERVICE.ECIBOK-OUT" = Table.ExpandRecordColumn(#"Expanded Document.data.ESWEBSERVICE", "Document.data.ESWEBSERVICE.ECIBOK-OUT", {"BKG-INFO"}, {"Document.data.ESWEBSERVICE.ECIBOK-OUT.BKG-INFO"}),
    #"Expanded Document.data.ESWEBSERVICE.ECIBOK-OUT.BKG-INFO" = Table.ExpandRecordColumn(#"Expanded Document.data.ESWEBSERVICE.ECIBOK-OUT", "Document.data.ESWEBSERVICE.ECIBOK-OUT.BKG-INFO", {"SEGS"}, {"Document.data.ESWEBSERVICE.ECIBOK-OUT.BKG-INFO.SEGS"}),
    #"Expanded Document.data.ESWEBSERVICE.ECIBOK-OUT.BKG-INFO.SEGS" = Table.ExpandRecordColumn(#"Expanded Document.data.ESWEBSERVICE.ECIBOK-OUT.BKG-INFO", "Document.data.ESWEBSERVICE.ECIBOK-OUT.BKG-INFO.SEGS", {"SEG"}, {"Document.data.ESWEBSERVICE.ECIBOK-OUT.BKG-INFO.SEGS.SEG"}),
    step1 = Table.ExpandRecordColumn(#"Expanded Document.data.ESWEBSERVICE.ECIBOK-OUT.BKG-INFO", "Document.data.ESWEBSERVICE.ECIBOK-OUT.BKG-INFO.SEGS", {"SEG"}, {"Document.data.ESWEBSERVICE.ECIBOK-OUT.BKG-INFO.SEGS.SEG"}),
    step2  = Table.RenameColumns(step1,{{"Document.data.ESWEBSERVICE.ECIBOK-OUT.BKG-INFO.SEGS.SEG", "Flights"}}),
    Flights1 = step2[Flights],
    #"Converted to Table" = Table.FromList(Flights1, Splitter.SplitByNothing(), null, null, ExtraValues.Error),
    step4 = Table.SelectRows(#"Converted to Table", each [Column1] <> null and [Column1] <> ""),
    fieldForRec  = Table.AddColumn(step4,"Rec",each if Value.Is([FLTINFO], type record) then [ORIGIN] else null,type record)
in
    fieldForRec

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.