Microsoft Power BI
Microsoft Windows 2016 server
You have a working Dynamic SQL query, but when you schedule it, it stop working.
Rebuild your query to not use Dynamic SQL, to make it possible to schedule it in PowerBi.
See if you can change to use fewer different data sources.