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

Get certified in Microsoft Fabric—for free! For a limited time, get a free DP-600 exam voucher to use by the end of 2024. Register now

Reply
PAPutzback2
Helper II
Helper II

How can I show the metadata of the Power Query tables

I am loading a handful of tables in of a database to show example data and would like to have a page in the report with a matrix to show each table and its columns. Is there a way to write this in code, or will I have to make a reference to each table and pivot the columns into rows?
Ultimately I am trying to create data dictionary for the enduser to be able to see every table and the columns that they have in order for them to make report requests.
Thanks.

3 ACCEPTED SOLUTIONS
amitchandak
Super User
Super User

@PAPutzback2 ,

You can copy a table and remove data and transpose and get all column name

Transpose : https://yodalearning.com/tutorials/power-query-helps-transposing-data/

 

 

If you install and use DAX studio , You can try running this query

Select * from $System.DBSCHEMA_TABLES WHERE TABLE_TYPE='SYSTEM TABLE'

 

And you can try to use result of this Table .

Join us as experts from around the world come together to shape the future of data and AI!
At the Microsoft Analytics Community Conference, global leaders and influential voices are stepping up to share their knowledge and help you master the latest in Microsoft Fabric, Copilot, and Purview.
️ November 12th-14th, 2024
 Online Event
Register Here

View solution in original post

I will go with the copy table and transpose method so everything can stay within the model.
Thanks!

View solution in original post

abpgupta
Continued Contributor
Continued Contributor

You can use Power Query function Table.Columnnames to get all column names.

View solution in original post

5 REPLIES 5
v-lionel-msft
Community Support
Community Support

Hi @PAPutzback2 ,

 

I suggest you use sql query instead of M query.

You can create a view containing table names and field names in the database and import this view into Power BI, or write SQL queries directly in the connector.

In doing so, you don't need to transform the data tables.

--SQL Server

v-lionel-msft_0-1619506183267.png

 

Best regards,
Lionel Chen

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

 

The data is not in SQL. It was pulled from an API straight into the model

amitchandak
Super User
Super User

@PAPutzback2 ,

You can copy a table and remove data and transpose and get all column name

Transpose : https://yodalearning.com/tutorials/power-query-helps-transposing-data/

 

 

If you install and use DAX studio , You can try running this query

Select * from $System.DBSCHEMA_TABLES WHERE TABLE_TYPE='SYSTEM TABLE'

 

And you can try to use result of this Table .

Join us as experts from around the world come together to shape the future of data and AI!
At the Microsoft Analytics Community Conference, global leaders and influential voices are stepping up to share their knowledge and help you master the latest in Microsoft Fabric, Copilot, and Purview.
️ November 12th-14th, 2024
 Online Event
Register Here

I will go with the copy table and transpose method so everything can stay within the model.
Thanks!

abpgupta
Continued Contributor
Continued Contributor

You can use Power Query function Table.Columnnames to get all column names.

Helpful resources

Announcements
November Carousel

Fabric Community Update - November 2024

Find out what's new and trending in the Fabric Community.

Live Sessions with Fabric DB

Be one of the first to start using Fabric Databases

Starting December 3, join live sessions with database experts and the Fabric product team to learn just how easy it is to get started.

Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Early Bird pricing ends December 9th.

Nov PBI Update Carousel

Power BI Monthly Update - November 2024

Check out the November 2024 Power BI update to learn about new features.