Forum Discussion

olegkazanskyi's avatar
olegkazanskyi
Icon for Helper II rankHelper II
4 years ago
Solved

DMV request to Power BI Server Analysis Services for hidden tables in PowerQuery

I try to get the list of tables with M codes from PowerBI online Analysis Service. I managed to get the required data with the request:   SELECT * FROM $SYSTEM.TMSCHEMA_PARTITIONS   But it does...
  • d_gosbell's avatar
    d_gosbell
    4 years ago

    lbendlin wrote:

    d_gosbell  that one also only shows the queries that have Load enabled.


    Not according to my tests.

     

    I just added 2 queries to DimProductCategory both set to disable the load, one was referenced as a merged query for DimProductSubcategory the other was completely unreferenced and both show up in the TMSCHEMA_EXPRESSIONS and neither show up in TMSCHEMA_PARTITIONS (although I can see a reference to the first one in the merge step in the DimProductSubcategory M code )

     

     

  • d_gosbell's avatar
    d_gosbell
    4 years ago

    lbendlin wrote:

    Interesting. I get rather inconsistent results. need to test more variations. What would be the reason for Query3 to not appear in the attached sample? 


    So the documentation for the DMVs is pretty poor, but it seems to me that TMSCHEMA_PARTITIONS contains the text for any queries that are loaded and TMSCHEMA_EXPRESSIONS contains the text for any queries that are not loaded.

     

    So when I query your file I see the following

     

    TMSCHEMA_PARTITIONS - shows "Query 3"

    TMSCHEMA_EXPRESSIONS - shows "Query 1" and "Query 2"

     


    lbendlin wrote:

     Where can I see the lineage details?


    If I query the DISCOVER_CALC_DEPENDENCY DMV I can see that "Query 3" has a dependency on "Query 1"

  • lbendlin's avatar
    lbendlin
    4 years ago

    Brilliant.  olegkazanskyi this means you need to run both DMVs to get your desired result.