Power Query Union Tablas sin Campos en Comun

%3CLINGO-SUB%20id%3D%22lingo-sub-1260928%22%20slang%3D%22es-ES%22%3EPower%20Query%20Union%20Tables%20Without%20Fields%20in%20Comun%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1260928%22%20slang%3D%22es-ES%22%3E%3CP%3EGood%20afternoon%2C%20I%20want%20to%20put%20together%20a%20consultation%20by%20joining%20two%20tables%3A%3C%2FP%3E%3CP%3ETable%201%20(two%20ID%20and%20No.%20fields)%3C%2FP%3E%3CP%3EID%20Noro%3C%2FP%3E%3CP%3E1%20A%201%3C%2FP%3E%3CP%3EB%202%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3ETable%202%20(one%20COUNTRY%20field)%3C%2FP%3E%3CP%3ECountry%3C%2FP%3E%3CP%3EAle%3C%2FP%3E%3CP%3EIta%3C%2FP%3E%3CP%3EFran%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EI%20want%20to%20generate%20a%20union%20of%20both%20with%20this%20result%3A%3C%2FP%3E%3CP%3EID%20No%20PAIS%3C%2FP%3E%3CP%3EA%201%20Ale%3C%2FP%3E%3CP%3EB%202%20Ale%3C%2FP%3E%3CP%3EA%201%20Ita%3C%2FP%3E%3CP%3EB%202%20Ita%3C%2FP%3E%3CP%3EA%201%20Fra%3C%2FP%3E%3CP%3EB%202%20Fra%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3ETables%20do%20not%20have%20common%20fields.%26nbsp%3B%20Is%20it%20feasible%20to%20do%20this%20type%20of%20union%20with%20power%20query%3F%2C%20how%20could%20it%20be%20achieved%3F%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-LABS%20id%3D%22lingo-labs-1260928%22%20slang%3D%22es-ES%22%3E%3CLINGO-LABEL%3EBI%20%26amp%3B%20Data%20Analysis%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3EExcel%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3EOffice%20365%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1261164%22%20slang%3D%22en-US%22%3ERe%3A%20Power%20Query%20Union%20Tablas%20sin%20Campos%20en%20Comun%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1261164%22%20slang%3D%22en-US%22%3E%3CP%3EHI%26nbsp%3B%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F598965%22%20target%3D%22_blank%22%3E%40Exemilenio%3C%2FA%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3Ecan%20you%20pls%20attached%20your%20query%20in%20excel%20file%20and%20post%20it%20again%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%3CSPAN%3ERegards%2C%20Faraz%20Shaikh%20%7C%20MCT%2C%20MIE%2C%20MOS%20Master%2C%20Excel%20Expert%3C%2FSPAN%3E%3C%2FP%3E%3CDIV%20class%3D%22lia-message-body%20lia-component-message-view-widget-body%20lia-component-body-signature-highlight-escalation%20lia-component-message-view-widget-body-signature-highlight-escalation%22%3E%3CDIV%20class%3D%22lia-message-body-content%22%3E%3CP%3E%3CEM%3E%3CFONT%20color%3D%22%23808080%22%3EIf%20you%20find%20the%20above%20solution%20resolved%20your%20query%20don't%20forget%20mark%20as%26nbsp%3B%3CSPAN%3EOfficial%20Answer%3C%2FSPAN%3E.%3C%2FFONT%3E%3C%2FEM%3E%3C%2FP%3E%3C%2FDIV%3E%3C%2FDIV%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1261461%22%20slang%3D%22en-US%22%3ERe%3A%20Power%20Query%20Union%20Tablas%20sin%20Campos%20en%20Comun%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1261461%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F598965%22%20target%3D%22_blank%22%3E%40Exemilenio%3C%2FA%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EWith%20this%20sample%3C%2FP%3E%0A%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22image.png%22%20style%3D%22width%3A%20301px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Fgxcuf89792.i.lithium.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F180168iB97B6893CBC36826%2Fimage-size%2Flarge%3Fv%3D1.0%26amp%3Bpx%3D999%22%20title%3D%22image.png%22%20alt%3D%22image.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3Equery%20could%20be%3C%2FP%3E%0A%3CPRE%20class%3D%22lia-code-sample%20language-markup%22%3E%3CCODE%3Elet%0A%20%20%20%20Source%20%3D%20Excel.CurrentWorkbook()%7B%5BName%3D%22IDs%22%5D%7D%5BContent%5D%2C%0A%20%20%20%20Country%20%3D%20Excel.CurrentWorkbook()%7B%5BName%3D%22Country%22%5D%7D%5BContent%5D%2C%0A%0A%20%20%20%20AddListOfCountries%20%3D%20Table.AddColumn(%0A%20%20%20%20%20%20%20%20Source%2C%0A%20%20%20%20%20%20%20%20%22Country%22%2C%0A%20%20%20%20%20%20%20%20each%20Country%5BCountry%5D%0A%20%20%20%20)%2C%0A%20%20%20%20ExpandCountries%20%3D%20Table.ExpandListColumn(%0A%20%20%20%20%20%20%20%20AddListOfCountries%2C%0A%20%20%20%20%20%20%20%20%22Country%22%0A%20%20%20%20)%2C%0A%20%20%20%20SortByCountry%20%3D%20Table.Sort(%0A%20%20%20%20%20%20%20%20ExpandCountries%2C%0A%20%20%20%20%20%20%20%20%7B%7B%22Country%22%2C%20Order.Ascending%7D%7D%0A%20%20%20%20)%0Ain%0A%20%20%20%20SortByCountry%3C%2FCODE%3E%3C%2FPRE%3E%3C%2FLINGO-BODY%3E
Highlighted
Occasional Visitor

Buenas tardes, quiero armar una consulta uniendo dos tablas:

Tabla 1 (dos campos ID y Nro)

ID   Nro

A     1

B     2

 

Tabla 2 (un campo PAIS)

PAIS

Ale

Ita

Fran

 

Quiero generar una union de ambas con este resultado:

ID  Nro  PAIS

A 1  Ale

B 2  Ale

A  1  Ita

B  2 Ita

A  1  Fra

B  2  Fra

 

Las tablas no tienen campos en comun.  Es factible hacer este tipo de union con power query?,  como se podria lograr?

2 Replies
Highlighted

HI @Exemilenio 

 

can you pls attached your query in excel file and post it again

 

Regards, Faraz Shaikh | MCT, MIE, MOS Master, Excel Expert

If you find the above solution resolved your query don't forget mark as Official Answer.

Highlighted

@Exemilenio 

With this sample

image.png

query could be

let
    Source = Excel.CurrentWorkbook(){[Name="IDs"]}[Content],
    Country = Excel.CurrentWorkbook(){[Name="Country"]}[Content],

    AddListOfCountries = Table.AddColumn(
        Source,
        "Country",
        each Country[Country]
    ),
    ExpandCountries = Table.ExpandListColumn(
        AddListOfCountries,
        "Country"
    ),
    SortByCountry = Table.Sort(
        ExpandCountries,
        {{"Country", Order.Ascending}}
    )
in
    SortByCountry