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 ,
what should actually happen for the 2 occurrances you mentioned: Do you want to keep the old data or do you want to create an empty table?
- Mann6 years agoResolver III
- ImkeF6 years agoCommunity Champion
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..."}, { { } } )
- Mann6 years agoResolver III
Anonymous
I want this code to run in Power BI Dekstop.
Mann.