Archive

Posts Tagged ‘Power Query’

#ProjectOnline reporting using #PowerBI Part2 #BI #Office365 #Reports #PPM #PMOT

August 7, 2015 Leave a comment

This is the second post for the Project Online reporting with Power BI intro I created earlier this week. If you missed it, a link to the post can be found below:

http://pwmather.wordpress.com/2015/08/04/projectonline-reporting-using-powerbi-part1-bi-office365-reports-ppm-pmot/

In this post we will look at creating new reports using the Power BI Desktop tool then adding these to Power BI.

Firstly if you haven’t already, download the Power BI Desktop: https://powerbi.microsoft.com/desktop.

Once launched you will see a getting started type page:

image

Close this and you will see a blank canvas:

image

The first thing we need to do is get the data, to do this click the Get Data button on the ribbon then OData feed:

image

In the  next window, paste in your Project Online OData feed, in this example I am using:

https://cpsppmdemo4.sharepoint.com/sites/PWA2PSMODE/_api/ProjectData/Projects

image

Click OK and you will see your data:

image

At this point you can click OK to load the data but I would Edit the data to only select the fields you want. So in this example I will click the Edit button to load the query editor. The Query editor is very similar to the Power Query editor you see in Excel:

image

I only want certain columns so I will select the columns I want then remove the others. To select the columns just click the first one and hold down the Ctrl key then click the rest:

image

Or use the Choose Columns button on the ribbon:

image

Once all selected, click the Remove Columns > Remove Other Columns:

image

Notice in the Query Settings pane you see the Applied Steps, so you can easily undo a step if required:

image 

That is the project data loaded, now I want to load the task data. In the Query Editor click New Source > OData feed:

image

Paste in the URL for the Tasks feed:

image

Click OK to add the new source. I then selected the columns I wanted and named the query:

image

There is also an advanced editor that I used to filter out the summary tasks by modifying the URL:

image

The advanced editor can be used to type the code to manipulate the data but use the UI where possible.

Now we have two individual datasets / queries, we need to merge the queries to create the join, click the Merge Queries button:

image

Chose the columns and table to join then the join type:

image

Click OK.

Once you are happy with the data click Close & Load > Close & Load:

image

This will load the dataset to the report, see the fields pane:

image

Then add your visualisations on, the first one I added is the Treemap:

image

Then drag the fields to the visualisation settings on the pane, in this example I use Project Name for the group property and % complete in the values property:

image

Add the other visualisations you need, the example I created looks like this:

image

I then added another page to visualise some task information:

image

A very basic report but that gives you the idea how easy it is to create visualisations of your Project Online data using the Power BI Desktop.

The next stage is to add this to Power BI. To do this I can either publish the report using the Publish button or from the Power BI site, upload the file. For this example I clicked the Publish button:

image

The report will then be available in Power BI. The manual way from the Power BI portal site is to click the Get Data button:

image

Then chose the type of data, for this example I will use Files:

image

Then click local file:

image

Locate the Power BI file (or can be Excel etc. but this was a Power BI file) and add the file:

image

Once loaded, Power BI will create the dataset, the report and create a dashboard with a link to the report (note, I removed everything from my Power BI portal so that is was clean for the screen shots :))

image

Clicking the link under the Reports heading will load my report:

image

Clicking on an element from a visualisation will filter the data in the other visualisations:

image

The first thing to do is set up the dataset to refresh, to do this click the ellipsis next to the dataset then click Schedule Refresh button on the fly out menu:

image

Expand Manage Data Sources:

image

Enter the credentials for both sources, click the Edit Credentials link, select the oAuth2 for the Authentication Method and click Sign in:

image

Enter the credentials for the Project Online tenant and click sign in. Repeat for the other data source.

Now expand the Schedule Refresh section and turn on the “Keep your data up-to-date”:

image

Click Apply. The data sources will update Daily now but you can also update it on demand using the Refresh Now option:

image

When the data is refreshing you will see a spinning icon next to the dataset:

image

Now lets look at the dashboard. I will create a new Dashboard called “Dashboard Example” using the + button next to the Dashboards heading:

image

Once created you will see a blank canvas:

image

Now I can pin visualisations to this dashboard. To start with access the report previous loaded, hover over a visualisation and click the pin icon:

image

Navigate back to the dashboard and you will see the visualisation:

image

Repeat this process until you have the dashboard you need, for example:

image

You can also create new visualisations from the dashboard using the natural language query “Ask a question…” field, start typing a question about the data, for example “show project work” will create a visualisation for the total project work in the dashboard:

image

This visualisation can then be pined using the pin too. You can also change the default visualisation for the data returned using the visualisation pane, see the example below for a different query:

image

Once finished, the visualisations can be been seen on the dashboard:

image

The properties of the tiles can be edited using the pencil icon:

image

This loads the Tile detail pane:

image

Clicking on a visualisation that was added from a report will navigate you to that report directly.

You can then share your dashboard out to other people in your organisation using the Share Dashboard option, this loads the following window:

image

Enter the email addresses and click Share.

This is just touching the surface of what you can do with Power BI, take a look today – it will be your favourite reporting tool!

#ProjectOnline / #ProjectServer reporting on auto / manually scheduled tasks #BI #Office365 #Excel #PowerQuery #PS2013

April 13, 2015 Leave a comment

One issue or query that has been raised a few times is that when reporting on manually scheduled tasks and auto scheduled tasks the Start / Finish date fields do not show the same data that they do in Project or PWA for the manually scheduled tasks. For example, take a look at the example project plan below:

image

If I generate a reporting for this project using the equivalent fields from the OData API, see below:

image

As you can see all tasks have start and finish dates. The Manually scheduled tasks that are either blank or have text displayed in Project Pro contain dates in the report. These default to the Project Start date. The OData query used is below:

Tasks()?$Select=ProjectName,TaskName,TaskStartDate,TaskFinishDate,TaskIndex

This can be quite misleading from a reporting point of view. There are two options (probably more but two documented here!), these are detailed below in order of preference:

Option 1:

The preferred option would be to create a calculated field in the report, in this example, as I am using Excel I will create this in Power Query. I have my dataset in the Power Query Editor like below:

image

The OData query used is below:

Tasks()?$Select=ProjectName,TaskName,TaskStartDate,TaskStartDateString,TaskFinishDate,TaskFinishDateString,TaskIsManuallyScheduled,TaskIndex

Now click Add Column > Add Custom Column:

image

Give the column a name then create the formula:

image

Click OK to add the new custom column, repeat for the finish date:

image

After re-ordering and removing some columns my dataset now looks like this in the Query Editor:

image

The final change is to update the Data Types of the columns, in this example I updated the TaskStartDate and TaskFinishDate columns to Date/Time and my calculated DisplayedStartDate and DisplayedFinishDate columns to Text:

image

Now I am happy with the query I click the Close & Load button on the Home tab:

image

This will load my data into Excel:

image

As you can see the data displayed in my calculated columns on my report match the data in the fields on my Project Plan:

image

Option 2:

The other option is to create new Enterprise Custom Fields in Project Online that are calculated. Using Start date as an example, create a task level text field that is based on  formula, the formula would be =[Start]. I have called the field “DisplayedStartDate”. In Project Pro:

image

In my updated Excel Report:

image

The OData query used is below:

Tasks()?$Select=ProjectName,TaskName,TaskStartDate,TaskFinishDate,DisplayedStartDate,TaskIndex

As you can see this also gives the correct data but does introduce two additional calculated task level fields in your Project Online configuration. It is recommended to keep the task level calculated fields to a minimum – ideally below 5 for performance reasons hence this option being the least preferred.