Forum Discussion

Alicia_Anderson's avatar
Alicia_Anderson
Icon for Resolver I rankResolver I
2 years ago

How do I combine two Power Queries into one to eliminate Unable to Combine error

I am having trouble combining two queries into one in order to eliminate the Unable to Combine error.   Please help.

Changesets

let
Source = #"Changeset-Dataflow",
#"Changed Type" = Table.TransformColumnTypes(Source,{{"ID", Int64.Type}}),
#"Invoked Custom Function" = Table.AddColumn(#"Changed Type", "Changeset", each #"Files changed"([ID])),
#"Expanded Changeset" = Table.ExpandTableColumn(#"Invoked Custom Function", "Changeset", {"count", "value.item.path"}, {"Count", "GitRepo/FilePath"}),
#"Extracted Text Before Delimiter" = Table.TransformColumns(#"Expanded Changeset", {{"GitRepo/FilePath", each Text.BeforeDelimiter(_, "/", 4), type text}}),
#"Removed Duplicates" = Table.Distinct(#"Extracted Text Before Delimiter", {"ID", "GitRepo/FilePath"}),
#"Fix Byron" = Table.ReplaceValue(#"Removed Duplicates","Byron B","B, Byron",Replacer.ReplaceText,{"By"}),
 #"Remove ()" = Table.TransformColumns(#"Fix Byron", {{"By", each Text.BeforeDelimiter(_, " ("), type text}}),
#"Changed Type1" = Table.TransformColumnTypes(#"Remove ()",{{"Count", Int64.Type}, {"ID", type text}})
in
#"Changed Type1"

 

Files Changed (function)

(chgset) =>
let
Source = Json.Document(Web.Contents("https://xxx/tfs/domain/_apis/tfvc/changesets/", [RelativePath=Number.ToText(chgset)&"/changes"])),
#"Converted to Table" = Table.FromRecords({Source}),
#"Expanded value" = Table.ExpandListColumn(#"Converted to Table", "value"),
#"Expanded value1" = Table.ExpandRecordColumn(#"Expanded value", "value", {"item"}, {"value.item"}),
#"Expanded value.item" = Table.ExpandRecordColumn(#"Expanded value1", "value.item", {"path"}, {"value.item.path"}),
#"Changed Type" = Table.TransformColumnTypes(#"Expanded value.item",{{"count", Int64.Type}, {"value.item.path", type text}})
in
#"Changed Type"

2 Replies

  • Keep everything inside a parttion.  Inline your functions and avoid things like 

     

    Source = #"Changeset-Dataflow"

  • Anonymous's avatar
    Anonymous
    Not applicable

    Hi Alicia_Anderson ,

    To combine your Power Queries effectively, you can either merge or append these queries, depending on whether you want to add columns from one query to another (merge) or add rows from one query to another (append).
    If you are looking to do a merge query, then both of your queries need to have at least one column of data used to match each other, with the same data type and display format.
    If it is an append query, then it is better for you to have the same number of columns and the data type of each column in both queries to avoid unnecessary errors.
    Can you provide a screenshot of the datasheet for your two queries? This may help you better.

    Best Regards,
    Dino Tao
    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.