Forum Discussion
Using PowerBI with Project for the Web - Reporting on Summary Tasks and associated SubTask progress
- 3 years ago
Hey Amit,
Thanks for the response. I have now realised that the tables and fields pulled in by the PowerBI template for Project on the Web are not complete. Pulling in the full dataset allows me to use a parent task field which effectively gives me a workaround for this.
Thanks again
J
After struggling with this for months, I finally found a very easy solution to sort the Project Tasks in the Power Query table for Power BI according the hierarchy they show in the original projects for the web project plan.
The msdyn_projecttask table from Dataverse does have a column called msdyn_displaysequence. You need to add a column first, that fills the msdyn_displaysequence values with leading zeros so that they all have the same format. Then add a new column that combines the texts from msdyn_project (which is the project id) and the formattet msdyn_displaysequence column.
When you sort this column from A-Z all tasks will be shown in the same order as they appear in the project plan.
Code:
let
Source = msdyn_projecttask,
AddDisplaySequenceAsText = Table.AddColumn(Source, "DisplaySequenceText", each Text.From([msdyn_displaysequence])),
ModifyDisplaySecquence = Table.AddColumn(AddDisplaySequenceAsText, "DisplaySequence", each
let
parts = Text.Split([DisplaySequenceText], ","),
beforeComma = List.First(parts),
afterComma = if List.Count(parts) > 1 then List.Last(parts) else "",
formattedBeforeComma = Text.PadStart(beforeComma, 5, "0"),
formattedValue = formattedBeforeComma & "," & afterComma
in
formattedValue
),
AddHierarchy = Table.AddColumn(ModifyDisplaySecquence, "Hierarchy", each Text.Combine({[msdyn_project], Text.From([DisplaySequence])}, ","))
in
AddHierarchy