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.
- 3 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 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.
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.
- lbendlin3 years agoSuper User
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 - BrandedSaiyan3 years agoAdvocate II
This ended up working great!
- lbendlin3 years agoSuper User
Both are queries. Partitions are loaded into the Vertipaq engine. Expressions are not loaded into the engine but may participate in the data pull, especially when other queries depend on them (even when you explicitly state you don't want to refresh them !).
You can tell by the italicization of the query name in Power Query.
- BrandedSaiyan3 years agoAdvocate II
Circling back here. I've been unable to find a way to run these queries from powershell. Any help would be greatly appreciated.
Thanks!
- BrandedSaiyan3 years agoAdvocate II
I really appreciate all your help, going to give this a try and get back to you! Thank you!
- lbendlin3 years agoSuper User
Note that there is a subtle difference between "PARTITIONS" and "EXPRESSIONS".
- BrandedSaiyan3 years agoAdvocate II
Thanks for pointing this out. I'm noticing for a report I'm currently working on I have 3 SQL Server datasources showing under PARTITIONS and 1 SQL Server source showing under EXPRESSIONS. I'm not able to determine the difference or why one shows under expressions. Any further insight is appreciated.