Tutorial: Connect to a GitHub repo with Power BI

In this tutorial, you connect to real data: the Power BI content public repository (also known as a repo) in the GitHub service. Power BI automatically creates a dashboard and report with the data. You see answers to questions like: How many people contribute to the Power BI public repo? Who contributes the most? Which day of the week has the most contributions? And other questions.

You can connect to your own private or public GitHub repos too. To use a Power BI template app to connect to your repos, see Connect to GitHub with Power BI.

Screenshot of a sample GitHub report in Power BI.

In this tutorial, you complete the following steps:

  • Sign up for a GitHub account, if you don't have one yet.
  • Sign in to your Power BI account, or sign up, if you don't have one yet.
  • Open the Power BI service.
  • Find the GitHub app.
  • Enter the information for the Power BI public GitHub repo.
  • View the dashboard and report with GitHub data.
  • Clean up resources by deleting the app.

If you're not signed up for Power BI, sign up for a free trial before you begin.

Prerequisites

To complete this tutorial, you need a GitHub account, if you don't already have one.

How to connect

  1. Sign in to the Power BI service (app.powerbi.com).

  2. In the nav pane, select Apps, then Get apps.

    Screenshot of the apps pane with apps and get apps highlighted.

  3. Enter GitHub in the search box. Select the app, and then choose Get it now.

    Screenshot of the GitHub template app with get it now highlighted.

  4. Select Install.

    Screenshot of the GitHub app install dialog.

  5. When you see the notification, Your new app is ready!, select Go to app.

  6. On the app landing page, select Connect your data.

    Screenshot of the app banner with connect your data highlighted.

  7. In the connect dialog, enter the repository name and repository owner of the repo. The URL for this repo is https://github.com/MicrosoftDocs/powerbi-docs. Enter MicrosoftDocs as the repository Owner, and powerbi-docs as the Repo name. Select Next.

    Screenshot of the connect dialog with owner, repo, and next highlighted.

  8. Make sure that Authentication Method is set to OAuth2, and then select Sign in and connect.

    Screenshot of the connecting dialog with authentication method and sign-in and connect highlighted.

  9. If prompted, follow the GitHub authentication instructions and give Power BI permission to access your data.

    • After Power BI can connect with GitHub, the data in your Power BI semantic model is refreshed once a day.
    • After Power BI imports the data, you see the contents in your new GitHub workspace.
  10. Select Workspaces in the nav pane to see the dashboard, reports, and semantic models. You can select More options (...) to view settings.

    Screenshot of the workspaces list. Workspaces and the GitHub workspace are highlighted.

  11. In workspace Settings, you can rename or delete the workspace.

    Screenshot of the workspace settings dialog with workspace name highlighted.

  12. Select your GitHub dashboard. You can minimize or expand the nav pane, so you have more room to see your data.

    The GitHub dashboard contains live data, so the values you see may be different.

    Screenshot of the GitHub dashboard with the navigation pane compressed with the icon to expand highlighted.

Ask a question

  1. Select the Ask a question about your data text box. Power BI opens the Q&A window and offers some sample questions.

  2. Enter how many users, Power BI offers a list of questions.

    Screenshot of the Q&A result screen with how many users highlighted.

  3. You can edit your question, for example, in between how many and users, type pull requests per.

    Power BI creates a bar chart visual that shows the number of pull requests per person.

    Screenshot of the Q&A result screen with a bar chart.

  4. Select the pin icon to pin the visual to your dashboard, then Exit Q&A.

View the GitHub report

  1. On the GitHub dashboard, select More options (...) on the column chart Pull Requests by Month. Choose Go to report.

    Screenshot of the pull requests by month tile with more options and go to report highlighted.

  2. Select a user name in the Total pull requests by user chart. A new tile appears with results for one user.

    Screenshot of the pull requests chart for a single user.

  3. Select the Punch Card tab to view the next page of the report. Now you can see volumes of work by hour of the day and day of the week.

    Screenshot of the punch card tile and commit bar charts.

Clean up resources

Now that you've finished the tutorial, you can delete the GitHub app.

  1. In the nav pane, select Apps.

  2. On the app tile, select More options (...) and then choose Delete.

    Screenshot of the GitHub app tile with apps, more options, and delete highlighted.

In this tutorial, you've connected to a GitHub public repo and gotten data, which Power BI has formatted in a dashboard and report. You've answered some questions about the data by exploring the dashboard and report. Now you can learn more about connecting to other services, such as Salesforce, Microsoft Dynamics, and Google Analytics.