Forum Discussion
shaunwilks
Helper V
8 years agoDynamic Data Source based on parameter
Hello all, Hopefully this is easier to explain that Im finding it is to do. I have done work with parameters that place the SQL Server and Database names into the Source in the Advanced Ed...
- Anonymous8 years ago
shaunwilks,
Here is an example for you.let #"Table 1" = (para as text) => if para = "test1" then let Source = Sql.Database("servername", "test",[Query="select * from Main"]) in Source else let Source = Excel.Workbook(File.Contents("path\Book1.xlsx"), null, true), #"Security public - Copy_Sheet" = Source{[Item="Security public - Copy",Kind="Sheet"]}[Data] in #"Security public - Copy_Sheet" in #"Table 1"
Regards,
Lydia
Tony_XXX
3 years agoRegular Visitor
thanks for sharing this great idea!!! 😛