pythonpython-3.xpowerbipowerbi-embeddedpower-bi-report-server

Exception: Power BI report is not embedded


I'm using powerbiclient with Python, I need to filter a dashboard, but I get this error:

Exception: Power BI report is not embedded

This is the code line where I get the error: filters = report.get_filters()

This is the authentication I have done and I have also generated an access token:

from powerbiclient.authentication import DeviceCodeLoginAuthentication
device_auth = DeviceCodeLoginAuthentication()

access_token = device_auth.get_access_token()

How can I embed the Power BI report?


Solution

  • I'm assuming you are referring to powerbi-jupyter.

    Refer to report.py where it is throwing the exception message. Faced similar issue earlier, and it turns out to be that the report class is not called.

    Once report class is called, it will set the report object with report details for the wrapper. Then when we call any of the methods, it will use the same report object.

    Make sure you initialize the report class by calling the report. Keeping it simple, display the report in the output cell and it will resolve the issue. You can also check if report embedded by report._embedded. Refer Load Report in output cell to load the report.

    If the issue still persists in your case, reframe your question with more details and sample code you are implementing.