Following on from my first post on currency conversion found below:
This post walks through a different option for working with multiple currencies. This post will create a similar report as seen below:
This report enables the project cost to be calculated based on project currency and rate for the year. In this example I have two projects that should be reporting costs in Euros,the PWA site is set up using Pounds (GBP) as are the resources that are used on those projects. So for those two projects in PWA the projects display a EUR symbol but there is no conversion to calculate the Euro rate from the GBP resource rates used.
In the steps below we walkthrough how to set up this example. Firstly in the Power BI Desktop client add the Projects OData feed:
- Click Get Data > OData Feed and add the Odata URL for your PWA site: <PWASite>/_api/ProjectData/Projects and click OK
- Click Edit to launch the Power BI Query Editor then click Choose Columns and uncheck Select All to deselect all the columns then select at least ProjectId, ProjectName, ProjectCurrency and ProjectType and click OK
- Click the dropdown menu on the ProjectType column and uncheck 7.
- Change the table from Query1 to Projects
The Projects table is now completed.
Now we need to create a currency table, still within the Query Editor see these steps:
- Click Enter Data and create 4 columns, Currency, Master, Date and Rate then enter the data as required and click OK, for the purpose of the blog post here is the data I entered:
- On my PWA instance, GBP is the default currency used for this demo / blog post so this is set to 1.00 then I have a example currencies / rates for Euros. The project data in my PWA instance ranges from 2016 to 2018 so I need rates to cover those years
- Click Add Column > Custom and enter the name “Year” with the formula of Column Date.Year([Date]) and click OK
- Right click on Master column and change the type to True / False
- Change the table name to CurrencyData
The currency table is now completed.
Now we need to get the Task Timephased data, still within the Query Editor opened from creating the currency table table, see these steps:
- New Source > OData Feed and add the OData URL for your PWA site: <PWASite>/_api/ProjectData/TaskTimephasedDataSet and click OK then OK again
- Click Choose Columns and uncheck Select All to deselect all the columns then select at least ProjectId, TaskCost, TaskIsProjectSummary and TimeByDay and click OK
- Change the table from Query2 to TaskData
- Click the dropdown menu on the TaskCost column, if it states “List may be incomplete” click load more and then uncheck 0. In the advanced editor check the filter is ([TaskCost] <> 0)
- Click the dropdown menu on the TaskIsProjectSummary column and uncheck false
- Click Add Column > Custom Column and enter the name “Year” with the formula of Date.Year([TimeByDay]) and click OK
- Click Merge Queries > Merge Queries, in the Merge window select Projects then select ProjectId in the TaskData table and ProjectId in Projects table:
- Click OK
- In the New Column column heading, click the Expand button, select just ProjectCurrency and uncheck the use original column name option:
- Click OK
- Click Merge Queries > Merge Queries, in the Merge window select CurrencyData then hold the Ctrl key down and click Year and then ProjectCurrency in the TaskData table and then Year and then Currency in the CurrencyData table like below:
- Click OK
- In the New Column column heading, click the Expand button, select just Rate and uncheck the use original column name option:
- Click OK
- Click Add Custom > Custom Column and enter the name “TaskCost_Converted” with the formula of [TaskCost] * [Rate] and click OK
- Right Click the column heading for TaskCost_Converted column and click Change Type > Decimal Number:
The TaskData table is now complete. Click Close & Apply > Close & Apply. Check the table relationships are correct, it should just be Projects linked to TaskData using ProjectId.
Now design the report as required. For the purpose of this blog post I created one table with the following fields:
Ensure TaskCost and TaskCost_Converted fields are set to Sum and all other fields on the table are set to Don’t summarize. If you need to work with multiple currencies in reports, try this out and extend it for your specific needs.