Forum Discussion

Arul's avatar
Arul
Icon for Super User rankSuper User
5 years ago
Solved

Count tables in Power bi model

Hi All,

 

How will we count automatically number of tables in power bi model?

 

Thanks,

  • Hey Arul ,

     

    if you just want your own tables without system tables, then execute the following query in DAX studio:

    select * from $SYSTEM.TMSCHEMA_TABLES

     

    In the Output window you will see the count of tables you have:

    Be aware that this contains also hidden tables, but this you can easily see in the result:

     

     

    If you need any help please let me know.
    If I answered your question I would be happy if you could mark my post as a solution ✔️ and give it a thumbs up 👍
     
    Best regards
    Denis
     

     

5 Replies

  • selimovd's avatar
    selimovd
    Icon for Most Valuable Professional rankMost Valuable Professional

    Hey Arul ,

     

    I don't think there is a way to count them directly in Power BI.

    DAX always needs a specific table reference and there is no such thing as a meta table in Power BI. In DAX Studio that would be possible ( select * from $SYSTEM.DBSCHEMA_TABLES), but as far as I know not in Power BI directly.

     

    If you need any help please let me know.
    If I answered your question I would be happy if you could mark my post as a solution ✔️ and give it a thumbs up 👍
     
    Best regards
    Denis
     
    • Arul's avatar
      Arul
      Icon for Super User rankSuper User

      Hi jdbuchanan71 selimovd ,

       

      I just need count of tables of my power bi model. The above query result is giving me the list of all the tables. I hope you understand my issue here.

       

      Thanks,

      -Arul

      • selimovd's avatar
        selimovd
        Icon for Most Valuable Professional rankMost Valuable Professional

        Hey Arul ,

         

        if you just want your own tables without system tables, then execute the following query in DAX studio:

        select * from $SYSTEM.TMSCHEMA_TABLES

         

        In the Output window you will see the count of tables you have:

        Be aware that this contains also hidden tables, but this you can easily see in the result:

         

         

        If you need any help please let me know.
        If I answered your question I would be happy if you could mark my post as a solution ✔️ and give it a thumbs up 👍
         
        Best regards
        Denis