Microsoft Fabric Community Conference 2025, March 31 - April 2, Las Vegas, Nevada. Use code MSCUST for a $150 discount.
Register nowThe Power BI DataViz World Championships are on! With four chances to enter, you could win a spot in the LIVE Grand Finale in Las Vegas. Show off your skills.
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.
Solved! Go to Solution.
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 .
I will go with the copy table and transpose method so everything can stay within the model.
Thanks!
You can use Power Query function Table.Columnnames to get all column names.
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
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
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 .
I will go with the copy table and transpose method so everything can stay within the model.
Thanks!
You can use Power Query function Table.Columnnames to get all column names.
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Prices go up Feb. 11th.
If you love stickers, then you will definitely want to check out our Community Sticker Challenge!
User | Count |
---|---|
137 | |
70 | |
64 | |
52 | |
50 |
User | Count |
---|---|
208 | |
91 | |
62 | |
59 | |
56 |