Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Earn the coveted Fabric Analytics Engineer certification. 100% off your exam for a limited time only!

Reply
jinweitan
Frequent Visitor

Combinar dos tablas creando más filas y columnas

Hola

Estoy tratando de combinar dos tablas donde:

Tabla 1:

IdPregunta 1Pregunta 2
1AA
2BA

Tabla 2:

IdPregunta 3Pregunta 4
3BC
4CA

Y con la esperanza de obtener un resultado de esto:

IdPregunta 1Pregunta 2Pregunta 3Pregunta 4
1AA
2BA
3 BC
4 CA

Me pregunto si puedo conseguir algún consejo sobre esto.

Muchas gracias.

1 ACCEPTED SOLUTION
2 REPLIES 2
amitchandak
Super User
Super User
FrankAT
Community Champion
Community Champion

Hola @jinweitan

puede hacerlo con Power Query de la siguiente manera:

// Table 1
let
    Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45WMlTSUXIE41idaCUjIMsJwosFAA==", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [ID = _t, #"Question 1" = _t, #"Question 2" = _t]),
    #"Changed Type" = Table.TransformColumnTypes(Source,{{"ID", Int64.Type}, {"Question 1", type text}, {"Question 2", type text}}),
    #"Appended Query" = Table.Combine({#"Changed Type", #"Table 2"})
in
    #"Appended Query"

// Table 2
let
    Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45WMlbSUXICYmelWJ1oJRMwS0fJUSk2FgA=", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [ID = _t, #"Question 3" = _t, #"Question 4" = _t]),
    #"Changed Type" = Table.TransformColumnTypes(Source,{{"ID", Int64.Type}, {"Question 3", type text}, {"Question 4", type text}})
in
    #"Changed Type"

08-09-_2020_17-33-25.png

Con saludos amables desde la ciudad donde la leyenda del 'Pied Piper de Hamelin' está en casa
FrankAT (Orgulloso de ser un Datanaut)

Helpful resources

Announcements
April AMA free

Microsoft Fabric AMA Livestream

Join us Tuesday, April 09, 9:00 – 10:00 AM PST for a live, expert-led Q&A session on all things Microsoft Fabric!

March Fabric Community Update

Fabric Community Update - March 2024

Find out what's new and trending in the Fabric Community.

Top Solution Authors