Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Try your skills in the Power BI Dataviz World Championship! Round one ends June 26. Join now

Reply
Analitika
Post Prodigy
Post Prodigy

Dynamically get database name in Power BI

I would like to ask how to get database name dynamically and add it as a new column in the table.

1 REPLY 1
Hariharan_R
Solution Sage
Solution Sage

Hi,

 If you use parameter to store the Servername and DBname then you can refer the parameter in the new column to get the database name. 

 

Hariharan_R_0-1654687994114.png

 

If you use SQL server then you can use below script in new query and get the database name.

 

let
Source = Sql.Database("ServerName", "AdventureWorks2019", [Query="SELECT DB_NAME()"])
in
Source

 

Thanks

Hari

Helpful resources

Announcements
Fabric Data Days is here Carousel

Data Days 2026

Don't miss out on Data Days, June 15 through August 7. Learn Fabric, Power BI, SQL, AI and more.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.