Forum Discussion
Need help
Hi
In a particular folder, i want to merge all files(txt files) from sharepoint. i got it for merging all files. but the thing is i want to filter the file if the particular word is present inside the file. is it possible.
and the other thing , i want to get all file names and file created date from the particular folder.
15 Replies
- MarcelBeugCommunity Champion
Since the November 2016 upgrade of Power BI, when you use "Combine Binaries" to expand your column with Binaries (the files from your folder), you get 4 grouped objects and 4 added steps to your code,
One of the objects is an example query "Transform Sample Binary from <name of your query>": you can modify this query to filter for your particular word. Any modifications to this query will be automatically applied to the function "Transform Binary from <name of your query>", meaning that the filtering will be applied to each of your files.
One of the steps added to your query is "Removed Other Columns1" (or similar). You can modify this step (using the small wheel right of the step name) to select other colums, like file cretaed date. The file name is already included by default.
- kalpanaHelper I
I dnt want to filter particular row in the file. i want to filter that file if that particular word is there inside the file
- MarcelBeugCommunity Champion
If you apply your filter to the example query and the word is not found, then the result will be an empty table.
If the word is found then you want to return the entire table, so you can add a step in your example query like:
Result = if Table.RowCount(#"Filtered Rows") = 0 then #"Filtered Rows" else Source
where Source is the step prior to the filter step.
Consequently, you will get null values for empty tables in your combined table (in your master query) after expanding.
There you can add a step to filter out the null values.