Power BI is turning 10, and we’re marking the occasion with a special community challenge. Use your creativity to tell a story, uncover trends, or highlight something unexpected.
Get startedJoin us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. Register now.
Hi. After a few hours of searching, I'm hopeful that someone can point me in the right direction. I've got a simple PowerShell script that connects to an endpoint and runs a simple DAX query (ex: "EVALUATE (<mytable>)". The command works perfectly fine when the table name doesn't have a space; but it fails when it does:
WORKS: [xml]$resp = Invoke-ASCmd -Query "EVALUATE (<mytable>)" -Server "powerbi://api.powerbi.com/v1.0/myorg/myorg" -Database "MyDb" -Verbose
FAILS: [xml]$resp = Invoke-ASCmd -Query "EVALUATE ('<another table>')" -Server "powerbi://api.powerbi.com/v1.0/myorg/anotherorg" -Database "AnotherDB" -Verbose
I've tried enclosing the table name in different quoting variations with no success. I've also run the same DAX query (with single quotes around the table name) in PowerBI desktop and everything is fine. PowerShell version didn't impact anything (tried with both 5.1 & 7). It should work; but it just doesn't.
Any guidance from the community would be appreciated.
Thanks!
I inheritied a project from a former employee and was just following their approach. The hope was to use the same approach (which works on tables without spaces); rather than redo the code.
Redo the code. You will see better performance too.
Why Invoke-ASCmd? Why not Invoke-PowerBIRestMethod ?
This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.
Check out the June 2025 Power BI update to learn about new features.
User | Count |
---|---|
4 | |
3 | |
3 | |
3 | |
3 |