Forum Discussion
Possible to Query Keywords in SQL Statement Datasource Using API?
- 4 years ago
You have to run it against each dataset (that you have access to) separately. However you can sort of automate that by running the queries from PowerShell.
- 4 years ago
Invoke-ASCmd -Server "powerbi://api.powerbi.com/v1.0/myorg/<workspace name here>" -Database "<dataset name here>" -Query "select * from `$SYSTEM.TMSCHEMA_PARTITIONS" | Out-File -FilePath c:\users\xxx\Downloads\dmv.xml
Thank you, do you have any helpful links or resources you'd reccomend?
There's DAX Studio , but beyond that the air is pretty thin. Mostly trial and error.
- BrandedSaiyan4 years agoAdvocate II
I have DAX studio, but I'm unfamilar with any function or code that extracts the M code. I'll do some digging, was just hoping to be pointed in the right direction. Thanks again.
- lbendlin4 years agoSuper User
In DAX Studio connect to your dataset (local or in service)
Run two queries (individually)
select * from $SYSTEM.TMSCHEMA_PARTITIONS
select * from $SYSTEM.TMSCHEMA_EXPRESSIONS
Grab the QueryDefinition column from the first and the Expression column from the second
Rinse and repeat for all your datasets.
- BrandedSaiyan4 years agoAdvocate II
Thank you! Do you know if I'm able to run this against a shared power bi dataset? Or if it can be ran more in bulk rather than foiir just one dataset at a time? Much appreciated.