The ultimate Fabric, Power BI, SQL, and AI community-led learning event. Save €200 with code FABCOMM.
Get registeredEnhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.
Hello,
I have defined two parameters (StartingDate and EndingDate).
The possible values of StartingDate are:
201001
201101
...
201901
The possible values of EndingDate are:
201012
201112
...
201912
Those parameters are set as text variable because, I tried with numerical parameters and it did not work.
See the query below:
= Sql.Database("ServerName", "DatabaseName", [Query="Select *#(lf)from Dim.CalendarPeriod cp#(lf)where cp.FiscalPeriodSkey between " & StartingDate & " and " & EndingDate & "#(lf)", MultiSubnetFailover=true])
By the help of the above mentioned scritp, it is possible to load just a part of the table.
Now let's say that
table1 will have the data for FiscalPeriodSkey between 201001 (first value of StartingDate) and 201012 (first value of EndingDate)
Table2 will have the data for FiscalPeriodSkey between 201101 (second value of StartingDate) and 201112 (second value of EndingDate)
... and so on.
If each parameter has 10 possible values, how can we make a do loop in m-Query in order to create Table1, Table2,..., Table10
Thanks in advance for your help
alepage
Hi @Anonymous ,
Based on my research, I am afraid that Power BI could not support this loop with M.
Regards,
Daniel He
User | Count |
---|---|
77 | |
76 | |
36 | |
31 | |
29 |
User | Count |
---|---|
93 | |
79 | |
57 | |
48 | |
48 |