Forum Discussion
Custom Power Query Code for refresh not to fail when there is no source data files
- 6 years ago
Hi Mann
Then you add a last step to your queries that checks for existing errors and in case of error, produces an empty table. Usually it is necessary to have the column names still in place. You can hardcode such a table like so:
#table( {"ColName1, ColName2..."}, { { } } )
The step would look like so:
try <PreviousStepName> otherwise #table( {"ColName1, ColName2..."}, { { } } )
Anonymous
Thanks for your thoughts on this.
Is it possible to do this technically in M query as I can't use Dataflows in current architecture.
If it is possible in M query can somebody give me some sample code to start with?
Mann.
<Looping some of Power Query experts who helped me learn through their impressive solutions in this community>
Hi Mann
As I said the sample will vary depens on where you run your code. Is this Excel or Power BI Desktop?
Thanks,
JB