Get certified for free when you join Fabric Data Days 2026 and dive into Fabric, Power BI, SQL, AI, and other essential data skills.
Join nowJuly 7 - July 17 | Round 2 of the Power BI Dataviz World Championships. Don't miss your chance! Learn more
Hello everyone,
I'm new to this community so I hope that I got the location right..
New in PowerBI, despite a few hours of research I can not find the solution.
I want to load multiple tables from my database with Power Query.
Situation :
Every end of the day, my table TAB which contains the daily productions data is archived with the name TAB_YYYY_MM, with YYYY curent year and MM curent month.
All the data of the month MM are stored in this table, for example for April 2019, the archive will be TAB_2019_04, for June-2018 => TAB_2018_06
With this concept, can someone help me how to load the rolling 12 months tables of history from curent date, in a dynamic way of course.
For today for example, it will be tables TAB_2018_04, TAB_2018_05, ..., TAB_2019_04 and TAB
Thanks for your help.
up
Hi @BBL ,
We can use DateTime.LocalNow() and Date.AddYears(DateTime.LocalNow(),-1) to work on it. Here I just filter the data by rows in a table for your reference, not tables. M code for your reference.
let
Source = Sql.Databases("localhost"),
Franktest = Source{[Name="Franktest"]}[Data],
dbo_Product = Franktest{[Schema="dbo",Item="Product"]}[Data],
#"Changed Type" = Table.TransformColumnTypes(dbo_Product,{{"SalesDate", type datetime}}),
#"Filtered Rows" = Table.SelectRows(#"Changed Type", each ([SalesDate] <= DateTime.LocalNow() and [SalesDate] >=Date.AddYears(DateTime.LocalNow(),-1)))
in
#"Filtered Rows"
Except the data are not in the same table.
And that's my question, how will I dynamically load the rolling 12 months tables, and daily productions data table TAB?
Join us in Barcelona for FabCon and SQLCon, the Fabric, Power BI, SQL, and AI community event. Save €200 with code FABCMTY200.
Join Fabric Data Days 2026: 60 days of free live/on-demand sessions, challenges, study groups, and certification opportunities.
| User | Count |
|---|---|
| 15 | |
| 14 | |
| 12 | |
| 11 | |
| 8 |
| User | Count |
|---|---|
| 40 | |
| 36 | |
| 29 | |
| 27 | |
| 24 |