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

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

Reply
Vivek_BI
New Member

Power BI Documentation

Thanks to Microsoft for providing the View Functions feature — it’s really useful.
Similarly, is there a way to automatically capture data source details such as the connected server and the queries used? I’d like to store all this information in a table for easy reference.

1 ACCEPTED SOLUTION
rohit1991
Super User
Super User

Hi @Vivek_BI 

There isn’t currently a built-in feature in Power BI that automatically documents all data source details (server name, database, query text) into a table. However, you can achieve something similar using a combination of built-in tools and external scripts:

1. Get Data Source Details in Power BI Desktop

  • File >> Options and Settings >> Data Source Settings will show each source and connection type.
  • Model View >> Properties can display the source details for each table.
  • In Power Query, right-click a query >> Advanced Editor to see the exact M code (including the connection and query text).

2. Export Metadata via External Tools

  • DAX Studio >> Advanced >>Export Metrics will produce a CSV with all tables, measures, and columns including source table names (for imported sources).
  • Tabular Editor can read the model metadata and export it as JSON or CSV.
  • The TOM (Tabular Object Model) via PowerShell or C# scripts can programmatically extract data source and query definitions from the PBIX file.

3. Automating Documentation

  • You can build a PowerShell script (or use the Power BI REST API with Get Datasources In Group) to pull dataset connection info from the Power BI Service automatically and store it in a table for reference.
  • For on-premises or gateway sources, the Get-PowerBIDatasource cmdlet in the MicrosoftPowerBIMgmt module can also retrieve server/database info.


Did it work? ✔ Give a Kudo • Mark as Solution – help others too!

View solution in original post

5 REPLIES 5
Shahid12523
Community Champion
Community Champion

You can capture Power BI data source details like server names and queries using tools like DAX Studio, Tabular Editor, or PowerShell scripts. For cloud datasets, use the Power BI REST API to fetch connection info. To log everything into a table, you'd need to extract metadata manually or automate it with scripts.

Shahed Shaikh
v-venuppu
Community Support
Community Support

Hi @Vivek_BI ,

I hope the information provided is helpful.I wanted to check whether you were able to resolve the issue with the provided solutions.Please let us know if you need any further assistance.

Thank you.

v-venuppu
Community Support
Community Support

Hi @Vivek_BI ,

May I ask if you have resolved this issue? Please let us know if you have any further issues, we are happy to help.

Thank you.

v-venuppu
Community Support
Community Support

Hi @Vivek_BI ,

Thank you for reaching out to Microsoft Fabric Community.

Thank you @rohit1991 for the prompt response.

I wanted to check if you had the opportunity to review the information provided and resolve the issue..?Please let us know if you need any further assistance.We are happy to help.

Thank you.

rohit1991
Super User
Super User

Hi @Vivek_BI 

There isn’t currently a built-in feature in Power BI that automatically documents all data source details (server name, database, query text) into a table. However, you can achieve something similar using a combination of built-in tools and external scripts:

1. Get Data Source Details in Power BI Desktop

  • File >> Options and Settings >> Data Source Settings will show each source and connection type.
  • Model View >> Properties can display the source details for each table.
  • In Power Query, right-click a query >> Advanced Editor to see the exact M code (including the connection and query text).

2. Export Metadata via External Tools

  • DAX Studio >> Advanced >>Export Metrics will produce a CSV with all tables, measures, and columns including source table names (for imported sources).
  • Tabular Editor can read the model metadata and export it as JSON or CSV.
  • The TOM (Tabular Object Model) via PowerShell or C# scripts can programmatically extract data source and query definitions from the PBIX file.

3. Automating Documentation

  • You can build a PowerShell script (or use the Power BI REST API with Get Datasources In Group) to pull dataset connection info from the Power BI Service automatically and store it in a table for reference.
  • For on-premises or gateway sources, the Get-PowerBIDatasource cmdlet in the MicrosoftPowerBIMgmt module can also retrieve server/database info.


Did it work? ✔ Give a Kudo • Mark as Solution – help others too!

Helpful resources

Announcements
September Power BI Update Carousel

Power BI Monthly Update - September 2025

Check out the September 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.