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

Learn from the best! Meet the four finalists headed to the FINALS of the Power BI Dataviz World Championships! Register now

Reply
MarioTechera
Frequent Visitor

Schema Name for Tables

Hello,

 

I have inherited a semantic model with quite a large number of tables coming from SQL Server.

The database contains also many schemas.

 

In the diagram view I cannot see the schema name for the tables. 

What is the easiest way to get the schema name for the tables in the semantic model?

 

Thanks for any tips.

 

Cheers!

2 ACCEPTED SOLUTIONS
danextian
Super User
Super User

Hi @MarioTechera 

You won't be able to see the schema because the tables loaded into or used in the model can be renamed. You can run INFO.PARTITIONS in DAX query view and filter the result to those that start with let which is what Power Query tables start with and those that contains the text Schema.

EVALUATE
FILTER (
    INFO.PARTITIONS (),
    LEFT ( [QueryDefinition], 3 ) = "let"
        && CONTAINSSTRING ( [QueryDefinition], "Schema" )
)

danextian_1-1770439537536.png

 

This would return a table that you can copy-paste to Excel.





Dane Belarmino | Microsoft MVP | Proud to be a Super User!

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


"Tell me and I’ll forget; show me and I may remember; involve me and I’ll understand."
Need Power BI consultation, get in touch with me on LinkedIn or hire me on UpWork.
Learn with me on YouTube @DAXJutsu or follow my page on Facebook @DAXJutsuPBI.

View solution in original post

divyed
Super User
Super User

Hello @MarioTechera ,

 

It can be difficult to fly blind in a large model, especially when you have overlapping table names across different schemas (like dbo.customer_orders and orders.customer_orders). By default, Power BI’s diagram view focuses on the model’s logical layer rather than the source’s physical metadata. Here are couple of steps you can take :

 

Example : I have imported 2 tables dbo.customer_orders and orders.customer_orders

 

1. Using Model View : suitable for less tables

   you can check individual table properties once you have imported the tables using below steps :

   Go to model view => Select a Table => go to properties => Check name or description

  

divyed_0-1770445824957.png

 

2. Using Power Query Steps : This is usually the fastest way to see every table's origin at once without writing code

   Setps : go to transform data => Queries => Select a table => Go to Applied Steps => click the Navigation step ( usually  2nd  step ) => check formula bar 

 

divyed_1-1770446044515.png

 

3. You can also use external tools like tabular editor 

 

Potential Fix :  When importing from a multi-schema SQL database, rename your tables in the Power Query editor to include a prefix (e.g., dbo_customer_orders and orders_customer_orders). This keeps the schema visible in the Diagram View and the Fields list.

 

I hope this helps.

 

Did I answer your query ? Kindly mark this as solution if this helps , apprciate your kudos :).

 

Cheers

Neeraj Kumar

 

    

 

   

    

   

LinkedIn : https://www.linkedin.com/in/neeraj-kumar-62246b26/

View solution in original post

4 REPLIES 4
Syndicate_Admin
Administrator
Administrator

Turn on TMDL if you don't already have it (it's preview, but already stable in 2026): Go to File > Options & Settings > >Preview features → Flag TMDL view → Restart Power BI if necessary.
In the left sidebar, select the TMDL view icon (it looks like a code or script, it's usually the last icon). In the Data pane or Semantic model pane, select one or more tables:

  • Drag the table (or Ctrl + click for several) into the code editor in TMDL view.
  • Or right-click on the table > Script to TMDL (or similar, depending on the language).
  • This automatically generates a TMDL script with the full table definition.
  • In the TMDL code that is generated, find the section of the table:

    text
    table MiTabla
        ...
        partition MiTabla
            mode import
            source
                type query
                query
                    let
                        Source = Sql.Database("servidor", "base_de_datos"),
                        Schema = Source{[Schema="nombre_del_esquema"]}[Data],
                        Tabla = Schema{[Name="nombre_tabla"]}[Data]
                    in
                        Tabla
                ...
    • The value in Schema="nombre_del_esquema" is exactly the original SQL Server schema (e.g., "dbo", "sales", "hr", and so on).

    If your query uses a native SQL query instead of schema/table navigation:

    • You'll see something like query="SELECT * FROM[outline].[ table] ...", and there also appears the diagram.


To view all tables at once:

  • Select the entire model (top in the Data pane) and drag it → Generate a large script with all the tables.

Use Ctrl + F in the TMDL editor to search for "Schema=" or "[schema]" and quickly find all schemas.

I hope this helps, in that case please mark it as a solution. Kudos are welcome.

MarioTechera
Frequent Visitor

Thanks @danextian and @divyed !
I was hoping there would be some way to directly display the schema name and original table names in the Model View but I guess it isn't possible. I'll definitely be using those workarounds.

 

Cheers.

divyed
Super User
Super User

Hello @MarioTechera ,

 

It can be difficult to fly blind in a large model, especially when you have overlapping table names across different schemas (like dbo.customer_orders and orders.customer_orders). By default, Power BI’s diagram view focuses on the model’s logical layer rather than the source’s physical metadata. Here are couple of steps you can take :

 

Example : I have imported 2 tables dbo.customer_orders and orders.customer_orders

 

1. Using Model View : suitable for less tables

   you can check individual table properties once you have imported the tables using below steps :

   Go to model view => Select a Table => go to properties => Check name or description

  

divyed_0-1770445824957.png

 

2. Using Power Query Steps : This is usually the fastest way to see every table's origin at once without writing code

   Setps : go to transform data => Queries => Select a table => Go to Applied Steps => click the Navigation step ( usually  2nd  step ) => check formula bar 

 

divyed_1-1770446044515.png

 

3. You can also use external tools like tabular editor 

 

Potential Fix :  When importing from a multi-schema SQL database, rename your tables in the Power Query editor to include a prefix (e.g., dbo_customer_orders and orders_customer_orders). This keeps the schema visible in the Diagram View and the Fields list.

 

I hope this helps.

 

Did I answer your query ? Kindly mark this as solution if this helps , apprciate your kudos :).

 

Cheers

Neeraj Kumar

 

    

 

   

    

   

LinkedIn : https://www.linkedin.com/in/neeraj-kumar-62246b26/
danextian
Super User
Super User

Hi @MarioTechera 

You won't be able to see the schema because the tables loaded into or used in the model can be renamed. You can run INFO.PARTITIONS in DAX query view and filter the result to those that start with let which is what Power Query tables start with and those that contains the text Schema.

EVALUATE
FILTER (
    INFO.PARTITIONS (),
    LEFT ( [QueryDefinition], 3 ) = "let"
        && CONTAINSSTRING ( [QueryDefinition], "Schema" )
)

danextian_1-1770439537536.png

 

This would return a table that you can copy-paste to Excel.





Dane Belarmino | Microsoft MVP | Proud to be a Super User!

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


"Tell me and I’ll forget; show me and I may remember; involve me and I’ll understand."
Need Power BI consultation, get in touch with me on LinkedIn or hire me on UpWork.
Learn with me on YouTube @DAXJutsu or follow my page on Facebook @DAXJutsuPBI.

Helpful resources

Announcements
Join our Fabric User Panel

Join our Fabric User Panel

Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.

February Power BI Update Carousel

Power BI Monthly Update - February 2026

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