Power BI

Blocks ::: block_powerbi
Maintained by Daniel Neis Araujo
This plugins integrates PowerBI Embedded dashboards.
Latest release:
31 sites
144 downloads
6 fans
Current versions available: 1

You can configure your own reports to be displayed inside Moodle.
Each report/dashboard is associated to one or more cohorts and only it's members can access the reports.
It's possible to use Power BI Dashboards filters sending data from current user's profile to the configured Table and Column.

Screenshots

Screenshot #0
Screenshot #1
Screenshot #2
Screenshot #3

Contributors

Daniel Neis Araujo (Lead maintainer)
Please login to view contributors details and/or to contact them

Comments RSS

Comments

  • Wed, Jul 21, 2021, 1:58 AM
    If you have a Power Bi embedded account on Azure, you can follow the instructions at:
    https://docs.microsoft.com/en-us/power-bi/developer/embedded/embed-sample-for-customers?tabs=net-core
  • Wed, Jul 21, 2021, 3:21 AM
    Thanks for the link. I can embed reports normally with embed code, but how do I use it with the plugin?
  • Wed, Jul 21, 2021, 3:25 AM
    After you have a Workspace ID and a Report ID, you can add the block to the dashboard and click on "manage reports" and then "add new report" and fill the form, then click to view the embeded report.
    After you add a new report it will be listed for admins.
    For non admin users you need to assign one or more cohorts to the report so members of the cohort will be able to view the report.
  • Wed, Jul 21, 2021, 5:20 AM
    Right! That makes sense and explains why I'm confused. Nothing is listed for Power BI in the drop down when I add a block. I can see it is enabled and I've added the settings to the plugin.
  • Wed, Jul 21, 2021, 4:22 PM
    Ok- we're making progress. We've managed to find the block and have added the report but we get this error when trying to view "Notice: Undefined property: block_powerbi\output\embedded_report::$filters in C:\inetpub\wwwroot\moodle\blocks\powerbi\classes\output\embedded_report.php on line 139".

    Also how do the filters work? There are 2 boxes with no label?
  • Wed, Jul 21, 2021, 10:07 PM
    Hello, Emma
    I've fixed the warning on the version that's on gitlab but still didn't updated it here.
    This usually means two things:
    1. You have not configured the Tenant ID, Client ID or Client Secret
    2. Your Moodle server could not successfully query one of these URLs: https://login.microsoftonline.com/ or https://api.powerbi.com/v1.0/myorg/groups/
    If it's not the case, please, let me know
  • Wed, Jul 21, 2021, 10:08 PM
    Filters work by filling the "Table" and "Field" that will be used as a filter on the Power BI Embedded Report, and which correspondent Moodle user field will be sent as value for this filter. You can optionally encode the value with base64 if needed.
  • Thu, Jul 29, 2021, 9:19 PM
    Hi. I'm working with Emma above trying to get the plugin working.

    To test that it is not our app registration or PBI setup, I created a .NET web app which integrates with PBI embed using exactly the same tenant, client id, secret, workspace and report id that we are supplying in the plugin config and it works perfectly. On the report view page of your plugin, it seems to have stopped giving us that filters error above but is presenting a blank page (with normal Moodle header/footer, the title we assigned in your config and a back button), but does not render a report. Running a fiddler/wireshark trace, we can see no calls to any PBI api endpoints. In dev tools we can see your PBI js file is loaded and no script errors are recorded in console. Just nothing appears to happen.

    We're really running out of ideas and welcome any thoughts?
  • Tue, Aug 3, 2021, 1:37 AM
    Hello, Steve
    It may be some permissions problem, maybe? This plugin uses the Service Principal API Access:
    https://docs.microsoft.com/en-us/power-bi/developer/embedded/embed-sample-for-customers?tabs=node-js#step-6---service-principal-api-access
    You should see the following on your browser's console:

    "we have been started embed.js:2:20
    Power BI SDK is trying to post /report/load before iframe is ready.
    Report load successful
    Report render successful"

    Also, if you look at the "Network" tab of the console, you'll find calls to many "powerbi" and "powerapps" URLS:
    https://app.powerbi.com/13.0.16512.57/scripts/ai.0.js
    https://content.powerapps.com/resource/powerbiwfe/scripts/reportEmbed.json-contracts.min.d86165c49c5e540ced48.js
    https://app.powerbi.com/13.0.16512.57/sharedresources/BaseThemes/CY19SU06.json
    https://dc.services.visualstudio.com/v2/track

    And there are some calls that are done on the server side, so you'll not find them inspection your client network:
    https://login.microsoftonline.com
    https://api.powerbi.com
    https://app.powerbi.com

    You can contact me privately here on moodle.org so we can find a solution.

    Best,
    Daniel
  • Tue, Aug 3, 2021, 8:34 PM
    Hi Daniel.

    Many thanks for the suggestions. Yes, we are using the service principal api access and our separate testing with our .NET application shows this is working as expected and has all the permissions required.

    From your point about the console messages, none of these appear and I can see they are part of the embed.js file. However, I can see this is not loaded. Can you think of a reason this js file is missing? It does not even attempt to load tis file.
  • Wed, Aug 4, 2021, 3:20 PM
    Hi Daniel

    I got to the bottom of it. It was a problem because of the use of cURL for https and for whatever reason was not seeing the microsoft endpoint cert as a trusted authority. Deployed cacert.pem resolved the problem. We're new to PHP so that did not help either. Maybe this will help someone else experiencing similar problems.

    Many thanks for your support and patience Daniel, the plugin looks great!
  • Thu, Aug 5, 2021, 5:18 PM
    Hi, sorry last question! The filtering - I still can't seem to get this to work.

    To confirm - the first column in the list is for the Table Title? The second is for a field name? The report has multiple pages, would this make a difference?
    Thanks again, really does look great!
  • Fri, Aug 6, 2021, 3:05 AM
    Hi, Emma!

    Yes, the first column is the "Table Title" on the report and the second is the "Field name".
    The third column is which field of the user profile Moodle will get the data from and send as the "Value" of the filter.
    You may have create filter on the report to be able to use it, but I'm really not sure.
    Please, let me know what you find.

    Best,
    Daniel
  • Wed, Sep 8, 2021, 6:32 AM
    Hey guys, first of all great job.

    ¿The only way to use is configuring with Azure Active Directory? I have an power BI account
  • Thu, Sep 9, 2021, 5:09 AM
    You must create an OAuth2 app on Azure portal. If you have a Power BI Embedded account, you may be able to do so. If you use Power BI desktop, it's not possible.
Please login to post comments