Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
6 years ago
Solved

Combining data from seperate queries

Hello!   I am needing help with the combining data from two different queries into one table.   I tried to creat a relationship between the two and that did not help. Basically, it is last month ...
  • v-lid-msft's avatar
    6 years ago

    Hi @Anonymous ,

    We can try appending two tables as a new query after creating a custom column for them:

    10.jpg11.jpg12.jpg13.jpg14.jpg15.jpg

    All inquiries are here:

    Current dlq collection:

    let
        Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45WMjQwUNJRMjIwMtA11DVFMA2VYnWilYwRssa65ggmUDYWAA==", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type text) meta [Serialized.Text = true]) in type table [amount_collected = _t, date = _t, start_of_month = _t]),
        #"Changed Type" = Table.TransformColumnTypes(Source,{{"amount_collected", Int64.Type}, {"date", type date}, {"start_of_month", type date}}),
        #"Added Custom" = Table.AddColumn(#"Changed Type", "Category", each "CurrentMonth")
    in
        #"Added Custom"

    Last month DLQ Collecte:

    let
        Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45WMjVQ0lEyMjAy0DXUtUQwDZVidaKVDI3hssa6pggmUDYWAA==", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type text) meta [Serialized.Text = true]) in type table [amount_collected = _t, date = _t, start_of_month = _t]),
        #"Changed Type" = Table.TransformColumnTypes(Source,{{"amount_collected", Int64.Type}, {"date", type date}, {"start_of_month", type date}}),
        #"Added Custom" = Table.AddColumn(#"Changed Type", "Category", each "LastMonth")
    in
        #"Added Custom"

    Anexo1:

    let
        Source = Table.Combine({#"Current DLQ Collecte", #"Last Month DLQ collected"})
    in
        Source

    If it doesn't meet your requirement, could you show the exact expected result based on the tables we've shared?


    Best regards