How to get Microsoft Graph API Data on Microsoft Power BI

Topics: Power BI

Good Morning Everyone! We are having a great week with lots of SharePoint projects. In the last three weeks, we have been getting queries regarding Power Apps and Power BI. After Microsoft has introduced free Power BI licenses for Office 365 Accounts (in the E3 Plan), users have started leveraging the integration capabilities of Power BI apps in our SharePoint Intranet Portal.

Now that we have a lot of queries about Microsoft Power BI and Power Apps integration with SharePoint, I came across the Microsoft Graph API using custom connectors for Power BI. There’s a lot of information you can find in this API. There are couple of Power BI themes available and the best one is to search for Power BI templates for finding all Power BI users and their groups.

To give a brief about Microsoft Graph, it is made up of resources that are connected by relationships. For e.g. one user can be connected to a group via “memberOfrelationship” and other can be connected using a manager relationship. The app can transverse the above-mentioned relationships to access data from the Microsoft Cloud services like Active Directory, SharePoint, OneDrive and much more.

Microsoft Graph.png

The main benefit of Graph API compared to other Microsoft Graph API’s is it has single endpoint.

The Graph API data source can be used in the Power BI Desktop where you can publish the model to Microsoft Power BI service and schedule data source. As of now, we don’t have the Power BI scheduling feature, but once it’s out, we can easily integrate Graph API using custom data connector.

You can find more information in this link:

https://github.com/Microsoft/DataConnectors/tree/master/samples/MyGraph

To get started, use the Microsoft Graph Explorer: 

https://developer.microsoft.com/en-us/graph/graph-explorer

You can see that Microsoft Graph supports 2 versions, beta and v1.0. I found beta better than the v1.0. You may wish to switch between them and checkout what type of data is available for each version. Please note that you have sufficient permission levels to get the right data. Ideally, an admin level permission is recommended. You can also modify permissions in Graph explorer. See the modify permissions just below your login name – left hand side.

Access Microsoft Graph API using Power BI

Login to your Power BI Desktop using your Microsoft Credentials. Click on Get Data and select OData feed. In simple clicks, you will be able to import the data to Microsoft Power BI Desktop easily.

Power BI OData feed.png

Just copy the API URL: https://graph.microsoft.com/beta/users from the Graph Explorer that can be pasted in the OData feed as shown in the image above.

Next, import the data shown in your dashboard and then it’s good to go.

Summary

Looks great, doesn’t it? It is a perfect data source where you can view your data with better visuals using Power BI. I’m sure you can get a lot of insights using this data source and hope you will leverage this feature.

See you soon with more tech blogs! Be sure to sign up for our e-newsletter for more SharePoint tips here

SharePoint & Office 365 Tips