LOAD *, FileName() AS Source FROM [lib://Data/sales_*.csv] (txt);
Loading many files (wildcards and FileName) in Power BI
Qlik loads every matching file with a wildcard in the FROM path, auto-concatenates them, and FileName() tells you which file each row came from. Power Query's Folder or SharePoint folder connector with Combine files does the same. It adds a Source.Name column, which is the FileName() equivalent. Filter on the file name to get the sales_*.csv pattern.
Short answer: Use Get data > Folder (or SharePoint folder). Filter the Name column with "begins with sales_" and Extension = ".csv", then choose Combine files. Keep Source.Name as the FileName() column.
What it does in Qlik
FROM [lib://Data/sales_*.csv]loads every matching file.FileName()returns the current file's name,FileBaseName()the name without extension, andFilePath()the full path.- Tables with identical columns are concatenated automatically.
Qlik example
Sales:
LOAD *, FileBaseName() AS SourceFile, Date#(Right(FileBaseName(), 6), 'YYYYMM') AS FileMonth
FROM [lib://Data/sales_*.csv] (txt, utf8, embedded labels, delimiter is ',');Power BI equivalent
Power Query (what Combine files generates, simplified)
let
Files = Folder.Files("C:\Data"),
Sales = Table.SelectRows(Files, each Text.StartsWith([Name], "sales_") and [Extension] = ".csv"),
Parsed = Table.AddColumn(Sales, "Data", each
Table.PromoteHeaders(Csv.Document([Content], [Delimiter = ",", Encoding = 65001]))),
Keep = Table.SelectColumns(Parsed, {"Name", "Data"}),
Combined = Table.ExpandTableColumn(Keep, "Data", {"OrderID", "Date", "Amount"}),
Month = Table.AddColumn(Combined, "FileMonth", each
Date.FromText(Text.End(Text.BeforeDelimiter([Name], "."), 6) & "01", [Format = "yyyyMMdd"]), type date)
in
MonthGotchas and behaviour differences
- The expand step lists column names explicitly. A new column in later files is ignored, and a renamed one becomes null. Qlik would create a separate table, or synthetic keys. Check the column list whenever the file layout changes.
- For SharePoint or OneDrive, use the SharePoint folder connector with the site URL, not
Folder.Fileson a synced local path. Otherwise scheduled refresh needs a gateway.
Official documentation
- FileName - script function (Qlik Help)
- FileBaseName - script function (Qlik Help)
- Folder connector (Microsoft Learn)
- Combine files overview (Microsoft Learn)
- SharePoint folder connector (Microsoft Learn)
Related pages
FOR EACH vFile IN FileList('lib://Data/*.csv') ... NEXT
FOR ... NEXT and FOR EACH loops
Power Query has no loop statement. It's a functional language. Loop over a list instead. List.Transform covers "do this for each item". List.Generate covers while-style loops. A custom function invoked per row of a table covers "load each file/table/month". Looping over files is built in as the Folder connector with Combine files.
Partial / different approach
Concatenate [(table)] LOAD ...
Concatenate (append tables)
Concatenate appends rows to an existing table. Qlik also does this automatically when field sets match. Power Query's Append queries (Table.Combine) matches columns by name and fills missing ones with null.
Direct equivalent
LOAD * INLINE [ ... ];
Inline load (hard-coded tables)
Inline loads define small tables in the script. In Power BI, use Enter data in the ribbon, a #table expression in Power Query, or DATATABLE in DAX.
Direct equivalent
Spotted an error or a better pattern? QlikToDax is maintained by a working BI consultant; corrections are welcome via the About page. Last reviewed 2026-10-25.