Jan 24 2022 05:16 AM
Hello, I'm facing this problem: I imported two different databases with powerquery from two files in the same folder; in the two files there is an important information missing but it is contained in the name of the respective files; hence my question: how can I add a column to my powerquery data model that contains the file name? In practice I would like that next to each record there was the name of the file in which that record is contained; thank you very much to anyone who wants to help me
Jan 24 2022 05:34 AM
It depends on which connector do you use. If From File -> From Folder you may keep filenames which are shown on first steps.
If you query single file you shall to have filename as parameter, you may add new column with that value.
Jan 24 2022 05:59 AM
Jan 25 2022 01:23 AM
Jan 25 2022 01:19 PM
Before expand Content be sure you have column as.
Expand Content, scripts will be generated and in main query you have steps like this
Depend on which columns did you keep before transformation and Power Query version it could keep could not column with file names. If not check Remove Other Columns step and correct it in formula bar (or remove at all and insert your own step which keeps proper columns).