Beginner’s Guide: Extracting Project Online Data into Power BI & Excel with Power Query

Originally posted on LinkedIn.

Photo Credit: Transformative Management Solutions LLC

Overview

This guide provides step-by-step instructions for extracting and transforming project task data from Microsoft Project Online using Power Query. By leveraging the Project Online Reporting API, you can pull structured JSON data into Excel or Power BI, convert it into a usable table, and apply necessary transformations for better reporting. This approach allows users to efficiently analyze project metrics, track task progress, and automate data retrieval.

What is the Project Online Reporting API?

Microsoft Project Online provides a Reporting API that allows users to extract project and task data in a structured format. This API is a REST-based service that delivers project data in JSON format, making it easy to integrate with reporting tools like Power BI and Excel. By accessing the API, users can retrieve key project metrics, track task progress, and generate custom reports.

Test Your Access Using Your Browser

You can explore the Project Online Reporting API directly in your web browser by navigating to the root node. To do this:

  1. Open your browser and log in to Project Online.
  2. Edit the following URL, replacing yourcompany with your actual SharePoint site name and pwa with your actual site URL if needed: https://yourcompany.sharepoint.com/sites/pwa/_api/ProjectData
  3. Press Enter to load the page.
  4. The browser will display a structured JSON response showing available datasets such as Projects, Tasks, Assignments, and more.

This is a useful way to verify API connectivity and explore available fields before writing queries.

Step 0: Open Power Query in Excel or Power BI

Before extracting data, you need to open Power Query. Follow these steps based on your tool:

In Excel:

  1. Open Excel and navigate to the Data tab.
  2. Click on Get Data > From Other Sources > Blank Query.
  3. This will open the Power Query Editor where you can enter your query.

In Power BI:

  1. Open Power BI and click Common data sources from the Home ribbon.
  2. Select Blank query. This will launch the Power Query Editor where you can enter your query.

Step 1: Define the Fields to Extract

There are 97 standard fields available in the Project Online Reporting API. To improve performance and simplify data processing, it is important to limit the selection to only the fields that are necessary for your report. We’ll put those fields in a JSON list for use later:

Photo Credit: Transformative Management Solutions LLC

Step 2: Retrieve Data from the Reporting API

Use the Web.Contents function to call the Reporting API with the selected fields.

Note: The parameters PWASiteUrl and ProjectUID must either be created or replaced with hard-coded values.

  • Example PWASiteUrl: https://yourcompany.sharepoint.com/sites/yoursitename
  • Example ProjectUID: 95d45d20-bb75-ef11-acfc-a2f1439cd6a1

You can find your ProjectUID by navigating to the project in Project Online and checking the URL.

If you need help creating and editing parameters in Power Query, refer to Microsoft’s documentation: Parameters – Power Query | Microsoft Learn

Photo Credit: Transformative Management Solutions LLC

Step 3: Convert JSON Response to Table

Convert the JSON response into a structured Power Query table.

Photo Credit: Transformative Management Solutions LLC

Step 4: Set Data Types for Columns

Apply proper data types to ensure accuracy in calculations and reporting:

Photo Credit: Transformative Management Solutions LLC

Step 5: Convert API Date Fields to Readable Format

Microsoft Project Online returns date values in a Unix timestamp format enclosed in a string (e.g., /Date(1726592400000)/). These timestamps represent the number of milliseconds since January 1, 1970 (the Unix epoch). Excel and Power BI, however, use a different date system, where dates are stored as serial numbers starting from January 1, 1900.

To correctly interpret these timestamps:

  • First, extract the numeric value from the string using Text.BetweenDelimiters(_, “(“, “)”).
  • Convert the extracted milliseconds to days by dividing by 86,400,000 (the number of milliseconds in a day).
  • Adjust the resulting value by adding 25,569, which represents the number of days between January 1, 1900, and January 1, 1970, to align with Excel’s date system.

The following transformations ensure that all date fields are properly converted into a human-readable datetime format:

Photo Credit: Transformative Management Solutions LLC

Try It Yourself!

To get started, open a blank query in Power Query by following these steps:

  1. Open Excel and navigate to the Data tab.
  2. Click on Get Data > From Other Sources > Blank Query.
  3. In the Power Query Editor, open the Advanced Editor (found under the Home tab).
  4. Paste the following code into the Advanced Editor window and click Done.

Now that you understand the process, copy and paste the full Power Query script into your Power Query Editor and run it against your Project Online data. Experiment with modifying the selected fields or adding additional transformations to customize the output for your needs.

Full Example Code

Here in this LinkedIn post you will find the complete Power Query script for extracting and transforming Project Online task data. Use this as a starting point for your own reports.

Conclusion

This Power Query script efficiently extracts task data from Microsoft Project Online, transforms JSON responses into a structured table, and applies necessary formatting. You can use this approach to automate data retrieval and improve reporting in Excel or Power BI.

Learn More + Earn 1 PDU!

Live Event with Eric Christoph: Excel & Power BI Supercharged – Unlock Project Online Data with Power Query

Join us to learn live and earn 1 PDU! In this live, hands-on webinar, we’ll walk you through the step-by-step process of using Power Query to seamlessly connect, transform, and analyze data from Microsoft Project Online. Whether you’re a project scheduler, data analyst, or Power BI enthusiast, this session will give you the tools to automate your workflows and build dynamic reports!

Don’t miss this opportunity to see in-depth demonstrations and ask questions in real time! Exclusive for MPUG members.

Register Here.


mpug logo

Elevate your project management skills and propel your career forward with an MPUG Membership. Gain access to 500+ hours of PMI-accredited training, live events, and a vibrant online community. Watch a free lesson and see how MPUG can teach you to Master Projects for Unlimited Growth. JOIN NOW


Written by Eric Christoph
Earlier in his career Eric served as Corporate EVM Subject Matter Expert for L-3 Communications. In that role he implemented multiple EIA-748 Earned Value Management Systems (EVMS) and helped build baseline plans for over 100 projects and proposal efforts with a combined value over $400B. Eric also represented L-3 on the Board of the NDIA Integrated Program Management Division (IPMD) which oversees the EIA-748 standard. Over the last fifteen years Eric has contributed to several key guidance documents related to EVM including the PMI Practice Standard for EVM, MIL-STD-881, and GAO-16-89G. Today, Eric is a Senior Partner at Transformative Management Solutions where we help project teams and organizations implement EVM and Agile project control solutions using Microsoft Power Platform technologies.
Share This Post
Have your say!
70

Leave a Reply