Forum Discussion
Anonymous
6 years agoNot applicable
Dynamically retrieving the DB name from the source in a column
Hi Everyone I need to copy multiple queries which are absolutely identical. The only change I make to these queries is the data source. Basically what I do is a copy of the query and then I go in ...
- 6 years ago
Hello Anonymous
what do you think of using a Variable for you DB-name and using this in the datasource as well as for adding a new column?
Here the code
let VARDB = "YOURDATABSENAME", Quelle = Sql.Database(VARDB, "Extension"), dbo_V_BSM_SummaryReportLarge = Quelle{[Schema="dbo",Item="V_BSM_SummaryReportLarge"]}[Data], Add = Table.AddColumn(dbo_V_BSM_SummaryReportLarge, "DB-Name", each VARDB) in AddIf this post helps or solves your problem, please mark it as solution (to help other users find useful content and to acknowledge the work of users that helped you)
Kudoes are nice too
Have fun
Jimmy
Jimmy801
Community Champion
6 years agoHello Anonymous
what do you think of using a Variable for you DB-name and using this in the datasource as well as for adding a new column?
Here the code
let
VARDB = "YOURDATABSENAME",
Quelle = Sql.Database(VARDB, "Extension"),
dbo_V_BSM_SummaryReportLarge = Quelle{[Schema="dbo",Item="V_BSM_SummaryReportLarge"]}[Data],
Add = Table.AddColumn(dbo_V_BSM_SummaryReportLarge, "DB-Name", each VARDB)
in
Add
If this post helps or solves your problem, please mark it as solution (to help other users find useful content and to acknowledge the work of users that helped you)
Kudoes are nice too
Have fun
Jimmy
Analitika
Post Prodigy
4 years agoI don't have this table in my database.