Forum Discussion

joshua1990's avatar
joshua1990
Post Prodigy
4 years ago
Solved

Get COUNTROWS for all Tables

Hello everyone!

I have a PBI File where I am connected to 50 tables.

Now I would like to get the number of rows for all tables at once without creating a measure for each table.

Is this possible within PBI or by using DAX Studio or Tabular Editor?

  • joshua1990 I'm not aware of a way to do that other than:

    Measure =
      VAR __Table1 = COUNTROWS('Table1')
      VAR __Table2 = COUNTROWS('Table2')
      VAR __Table3 = COUNTROWS('Table3')
    RETURN
      __Table1 + __Table2 + __Table3

    Another possibility would be to use DMV's which are at the heart of the Vertipaq Analyzer might be a path to victory. [MS-SSAS]: DISCOVER_STORAGE_TABLES | Microsoft Docs

1 Reply

  • Greg_Deckler's avatar
    Greg_Deckler
    Community Champion

    joshua1990 I'm not aware of a way to do that other than:

    Measure =
      VAR __Table1 = COUNTROWS('Table1')
      VAR __Table2 = COUNTROWS('Table2')
      VAR __Table3 = COUNTROWS('Table3')
    RETURN
      __Table1 + __Table2 + __Table3

    Another possibility would be to use DMV's which are at the heart of the Vertipaq Analyzer might be a path to victory. [MS-SSAS]: DISCOVER_STORAGE_TABLES | Microsoft Docs