Power BI is turning 10, and we’re marking the occasion with a special community challenge. Use your creativity to tell a story, uncover trends, or highlight something unexpected.
Get startedJoin us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. Register now.
Hi experts,
I have 2 files - File1 & File2
While importing files in power bi, I need File1 should be selected when [Date created] is before 17-09-2022 03:45:59 else File2 should be selected.
Thank you in advance!
Solved! Go to Solution.
You're nearly there. Just put the file names as a second condition in a boolean filter:
= Table.SelectRows(
Source,
each ( [Date created] < #date(2022, 09, 17) and Text.StartsWith([Name], "File1_") )
or ( [Date created] >= #date(2022, 09, 17) and Text.StartsWith([Name], "File2_") )
)
Pete
Proud to be a Datanaut!
Hi @liberty20 ,
Use a folder connector to connect to the folder(s) the files are in.
You should get a view something like this where you can filter using file metadata before expanding the [Content] column to append all filtered files:
Pete
Proud to be a Datanaut!
Thank you for a quick response!
I am using sharepoint folder as a source and both the files are present in same folder.
I need both the files in my data but one file is having historic data(before 17-09-2022) +current data(after 17-09-2022) and second file is having current data only (after 17-09-2022).
Expected result should be :
= Table.SelectRows(Source, If [Date created] is before 17-09-2022 then each Text.StartsWith([Name], "File1_") else Text.StartsWith([Name],"File2_))
As per your suggestion, if I will apply filter on files then I will get both the files and data after the date 17-09-2022 will get duplicated as both the files are having data for that dates.
You're nearly there. Just put the file names as a second condition in a boolean filter:
= Table.SelectRows(
Source,
each ( [Date created] < #date(2022, 09, 17) and Text.StartsWith([Name], "File1_") )
or ( [Date created] >= #date(2022, 09, 17) and Text.StartsWith([Name], "File2_") )
)
Pete
Proud to be a Datanaut!
This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.
Check out the June 2025 Power BI update to learn about new features.
User | Count |
---|---|
17 | |
10 | |
8 | |
8 | |
7 |