Skip to main content
This notebook showcases an agent interacting with a Power BI Dataset. The agent is answering more general questions about a dataset, as well as recover from errors. Note that, as this agent is in active development, all answers might not be correct. It runs against the executequery endpoint, which does not allow deletes.

Notes

  • It relies on authentication with the azure.identity package, which can be installed with pip install azure-identity. Alternatively you can create the powerbi dataset with a token as a string without supplying the credentials.
  • You can also supply a username to impersonate for use with datasets that have RLS enabled.
  • The toolkit uses a LLM to create the query from the question, the agent uses the LLM for the overall execution.
  • Testing was done mostly with a gpt-3.5-turbo-instruct model, codex models did not seem to perform ver well.

Initialization

Example: describing a table

Example: simple query on a table

In this example, the agent actually figures out the correct query to get a row count of the table.

Example: running queries

Example: add your own few-shot prompts


Connect these docs to Claude, VSCode, and more via MCP for real-time answers.