Forum Discussion
dmarics28
6 years agoFrequent Visitor
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. ...
- 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 SourceBTW, .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.
mahoneypat
Microsoft Employee
6 years agoYou can just put = Query1 (the name of your query). This will add the entire query into a table on each row. Is that your desired outcome?
If this works for you, please mark it as the solution. Kudos are appreciated too. Please let me know if not.
Regards,
Pat
- dmarics286 years agoFrequent Visitor
No, That didnt work.
That returned an error.Expression.Error: The name 'query1' wasn't recognized. Make sure it's spelled correctly.