Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
v-rahyadav
Employee
Employee

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 5
bcdobbs
Super User
Super User

I think my solution on this post might help:

 

https://community.powerbi.com/t5/Service/XMLA-dataset-tables-created-with-dataflow-do-not-have-M-cod...

 

You need to access the M code from the table partitions:

 

SELECT *
FROM $SYSTEM.TMSCHEMA_PARTITIONS



Ben Dobbs

LinkedIn | Twitter | Blog

Did I answer your question? Mark my post as a solution! This will help others on the forum!
Appreciate your Kudos!!

@bcdobbs  This is aweome to say the least !!! Fantastic !!! Thanks for sharing. 

Did I answer your question? Mark my post as a solution!
Proud to be a Super User!
My custom visualization projects
Plotting Live Sound: Viz1
Beautiful News:Viz1, Viz2, Viz3
Visual Capitalist: Working Hrs

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 ASC

 

which is from Dynamic Management Views (DMVs) in Analysis Services | Microsoft Docs



Ben Dobbs

LinkedIn | Twitter | Blog

Did I answer your question? Mark my post as a solution! This will help others on the forum!
Appreciate your Kudos!!
AlexisOlson
Super User
Super 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.

@AlexisOlson  OP is referring to this

https://www.fourmoo.com/2021/11/24/how-did-i-keep-my-power-bi-dataset-measures-documented-and-up-to-...

 

@v-rahyadav  "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.

 

smpa01_0-1638897608757.png

 

Did I answer your question? Mark my post as a solution!
Proud to be a Super User!
My custom visualization projects
Plotting Live Sound: Viz1
Beautiful News:Viz1, Viz2, Viz3
Visual Capitalist: Working Hrs

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.

Top Solution Authors