Forum Discussion
Dynamically retrieving the DB name from the source in a column
- 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
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
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
- Anonymous6 years agoNot applicable
Perfect!
I have combined this with a parameter and made it even easier to pick my DB (now it's just one click in the parameter list and I have both the correct databse and column populated!)
Thanks a lot - Analitika4 years ago
Post Prodigy
I don't have this table in my database.