Forum Discussion

dmarics28's avatar
dmarics28
Frequent Visitor
6 years ago
Solved

Trying to create a new column based on the query or source file name.

Hi Guys, I am trying to create a simple new column in my dataset. But I need the data to be the Query name. What is the formula for Query Name? Or Source File name? Thanks in advance.    ...
  • Icey's avatar
    6 years ago

    Hi dmarics28 ,

     

    Try to change the code of your Append query in the Advanced Editor.

    let
        Source = Table.Combine({Table.AddColumn(#"query A", "source query", each "query A")
                                , Table.AddColumn(#"query B", "source query", each "query B")
                                , Table.AddColumn(#"query C", "source query", each "query C")})
    in
        Source

     

    BTW, .pbix file attached.

     

     

     

    Best Regards,

    Icey

     

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