Earn the coveted Fabric Analytics Engineer certification. 100% off your exam for a limited time only!
Hi All,
I am using csv file a source to Power BI report. These csv file is coming to Azure blob storage everyday. Some times I am receiving blank file (without even column headers) in blob. When Power BI is refreshed it ends up with error as it could not find the required columns in that file.
Can we handle these blanks files with some logic in Power query. Something like if any error happens no refresh of this file should happen or Power query should create a file with column headers only.
Thanks
Solved! Go to Solution.
On solution is to create a query that contains all the correct column names. Then in the csv, remove the promote headers step and append the csv below the other query. Lastly filter out the original headers from the csv with a simple filter drop down.
You still get the headers, but they come from the manual query, not the csv
I assume you have some combine files logic in Power Query. In the query that gets loaded, there will be a step that adds a new column using the standard file function. You cand edit the query before that step to filter out blank csv files. You may have to extract the file size to identify the blank files, then filter from there
On solution is to create a query that contains all the correct column names. Then in the csv, remove the promote headers step and append the csv below the other query. Lastly filter out the original headers from the csv with a simple filter drop down.
You still get the headers, but they come from the manual query, not the csv
User | Count |
---|---|
128 | |
108 | |
100 | |
64 | |
62 |
User | Count |
---|---|
136 | |
113 | |
102 | |
71 | |
60 |