Forum Discussion

porcarius's avatar
porcarius
Regular Visitor
1 year ago
Solved

Get number of rows for table partition

I would like to get regurarly info about number of rows for each partition on several models. I used TOM, but there is no such info (it seems so). I tried Power BI Rest API, but here I get "Error: 404 - {"error":{"code":"ItemNotFound","message":"Dataset XXX is not Push API dataset."}}".
How to get the same info as in SSMS?

 

  • Allegedly via 

     

     

    select * from $SYSTEM.DISCOVER_XML_METADATA

     

     

    or

     

     

    <Discover xmlns="urn:schemas-microsoft-com:xml-analysis">
       <RequestType>DISCOVER_XML_METADATA</RequestType>
       <Restrictions />
       <Properties>
         <PropertyList>
           <Content>Data</Content>
         </PropertyList>
       </Properties>
     </Discover>

     

     

    but I can't get that to work in Power BI, and in PowerShell it only goes to the database level, not the table level.  Wonder if you could do some network sniffing when running the advanced metrics (or meta data refresh) in DAX Studio.

  • Anonymous's avatar
    Anonymous
    1 year ago

    Thanks for the reply from lbendlin , please allow me to provide another insight:

    Hi, porcarius 

    Regarding your question, I have also found the following information:

     

    TMSCHEMA_PARTITIONS

    DISCOVER_PARTITION_DIMENSION_STAT

    DISCOVER_PARTITION_STAT

    For details, please refer to:
    Dynamic Management Views (DMVs) in Analysis Services | Microsoft Learn
    $PARTITION (Transact-SQL) - SQL Server | Microsoft Learn

     
    Of course, if you have any new discoveries or questions, please feel free to get in touch with us.
     

    Best Regards,

    Leroy Lu

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

  • lbendlin's avatar
    lbendlin
    1 year ago

    As I said - do a network sleuth on what DAX Studio does.  It can show these metrics either without the permissions or by elevating them somehow.

5 Replies

  • Allegedly via 

     

     

    select * from $SYSTEM.DISCOVER_XML_METADATA

     

     

    or

     

     

    <Discover xmlns="urn:schemas-microsoft-com:xml-analysis">
       <RequestType>DISCOVER_XML_METADATA</RequestType>
       <Restrictions />
       <Properties>
         <PropertyList>
           <Content>Data</Content>
         </PropertyList>
       </Properties>
     </Discover>

     

     

    but I can't get that to work in Power BI, and in PowerShell it only goes to the database level, not the table level.  Wonder if you could do some network sniffing when running the advanced metrics (or meta data refresh) in DAX Studio.

  • Anonymous's avatar
    Anonymous
    Not applicable

    Thanks for the reply from lbendlin , please allow me to provide another insight:

    Hi, porcarius 

    Regarding your question, I have also found the following information:

     

    TMSCHEMA_PARTITIONS

    DISCOVER_PARTITION_DIMENSION_STAT

    DISCOVER_PARTITION_STAT

    For details, please refer to:
    Dynamic Management Views (DMVs) in Analysis Services | Microsoft Learn
    $PARTITION (Transact-SQL) - SQL Server | Microsoft Learn

     
    Of course, if you have any new discoveries or questions, please feel free to get in touch with us.
     

    Best Regards,

    Leroy Lu

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

    • porcarius's avatar
      porcarius
      Regular Visitor

      I get an error:
      Executing the query ...
      Obtained object of type: Microsoft.AnalysisServices.AdomdClient.AdomdDataReader
      The '<euii>xxx</euii>' user does not have permission to call the Discover method.

      Any suggestion? 
      The query to other DMVs than DISCOVER* works well, e.g.: select * from $SYSTEM.TMSCHEMA_PARTITIONS
      I am on Power BI Premium Capacity, XMLA is ReadWrite.

      • lbendlin's avatar
        lbendlin
        Icon for Super User rankSuper User

        As I said - do a network sleuth on what DAX Studio does.  It can show these metrics either without the permissions or by elevating them somehow.