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

Calling all Data Engineers! Fabric Data Engineer (Exam DP-700) live sessions are back! Starting October 16th. Sign up.

Reply
ekimakIA
Frequent Visitor

How to get Database name for ODBC Datasource from Power BI

Hi,

 

Is there any API or any DAX Query through which we can get the database name for ODBC Source type. We tried the Datasource API for Dataset and Gateway both, but in that we are not getting details related to database name for ODBC source as shown below.

Datasource APIDatasource API

 

We also tried the DAX query as shown below, which is " SELECT * from $SYSTEM.DISCOVER_STORAGE_TABLES" in which we get the Table details and in this we can see database name as a column which contains Database ID but we want name of the database.

 

DAX QueryDAX Query

 

Please let us know if there any API or any DAX query to get the database name for ODBC source type only.

 

Thank you

3 REPLIES 3
GilbertQ
Super User
Super User

Hi @ekimakIA 


That databaseID is actually the Power BI Database ID and not your ODBC database name.

 

As mentioned you will need to get this from the API.





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!







Power BI Blog

GilbertQ
Super User
Super User

Hi @ekimakIA 


From your screenshot the table name is below?

 

GilbertQ_0-1639088176073.png

 

Otherwise what about looking at the Gateway API to get all the data sources?

You could then match the datasourceID from the GatewayAPI and match it to the above API?

 

I have done something similar to this in the past





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!







Power BI Blog

Hi @GilbertQ ,

 

We need a database name of the table for ODBC connection. Through Gateway API for datasources we are getting the same result in which it doesn't contain the database name for ODBC connection type. From DAX query, we are getting database id but we are looking for the database name for the highlighted table.

 

ekimakIA_1-1639389998943.png

 

 

 

Helpful resources

Announcements
FabCon Global Hackathon Carousel

FabCon Global Hackathon

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

Check out the October 2025 Power BI update to learn about new features.

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Solution Authors
Top Kudoed Authors