#Data Modelling #Power Query


I am stuck with a scenario wherein , i need to fetch data from SQL , wherein my table name changes dynamically every month i.e.

for current month table name is ABC_201908
Next month a new table would be created ABC_201909
So there would be two tables in month of September and requirement is to fetch data from the newest table i.e. ABC_201909.

Note that ABC_ is always constant.

Kindy request you to provide your help for the same


Can you actually just sort this at the source, as in within SQL.

I’m just not sure this is really best practice to create bandaids for this in Power BI, changing this at the source would the preferred.

Potentially you could create a function which retrieves the current year/month and feed that into your query somehow, but honestly I would personally go for attempting to fix this within sql. Look to standardize things more here.


Thanks for the quick response, I have suggested the same to my back-end.
Wherein a view would be created by them and would consume the view into Power BI.

Thanks once again for looking into this

Thanks to the contributors of this post. Due to the length by which this post has been active, we are tagging it as Solved. For further questions related to this post, please make a new thread.