Forum Discussion
Scan dataset M codes.
We want to scan datasets M codes using XMLA endpoint to get information on how tables have been created.
We found that we can do this for tables created from Excel, SQL, manual inputs.
But the tables created from dataflow are not shown in the list of M Queries.
I use this command to request M codes:
select * from
$system.discover_m_expressions
5 Replies
- bcdobbsCommunity Champion
I think my solution on this post might help:
You need to access the M code from the table partitions:
SELECT *
FROM $SYSTEM.TMSCHEMA_PARTITIONS- bcdobbsCommunity Champion
All sorts of fun available...
Following code gives you list of all those queries:
SELECT * FROM $System.DBSchema_Tables
WHERE TABLE_TYPE = 'SCHEMA'
ORDER BY TABLE_NAME ASCwhich is from Dynamic Management Views (DMVs) in Analysis Services | Microsoft Docs
- AlexisOlsonSuper User
Are you expecting to retrieve the M code that generates the dataflow or just some M code that connects to the dataflow? I don't think the former exists within a Power BI dataset.
- smpa01Community Champion
AlexisOlson OP is referring to this
Anonymous "But the tables created from dataflow are not shown in the list of M Queries" - yes it does not work there. I have tested it and I guess the only tables that show up there are the ones exclusively created through M.
There isno DMV there.