Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.
Register now!Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes! Register now.
Hello Power BI Community,
There is a potent but little-known feature in MS Project known as Task.PathDrivingPredecessor, which according to MSFT documentation "gets a value that indicates whether the task is a predecessor that drives the selected task, when the Driving Predecessors item is selected in the Task Path drop-down list. Read-only Boolean."
Based on initial research, this feature has not been made available to Power BI, but would be a giant win for the community for anyone interested to take notice of this analytical gem.
However, the VBA is not simple. The below code (which is copied from the documentation linked above) returns true/false for task predecessors when a given task is selected. If written as a measure, the measure will dynamically change conditional formats as you click through rows of the project schedule once connected to and added into Power BI.
This might need the heroes' attention. Go ahead, be a hero! Thank you in advance.
Option Explicit
Sub TestTaskPath()
Dim t As Task
Dim chkTsk As Task
Dim selectedTaskId As Integer
For Each t In ActiveProject.Tasks
selectedTaskId = t.ID
Application.SelectRow Row:=selectedTaskId, RowRelative:=False
If Not (ActiveSelection.Tasks Is Nothing) Then
Debug.Print
With ActiveSelection.Tasks(1)
Debug.Print "Selected task ID " & .UniqueID & ", name: " & .Name
End With
For Each chkTsk In ActiveProject.Tasks
If Not (chkTsk.ID = selectedTaskId) Then
If chkTsk.PathPredecessor Then
Debug.Print vbTab & chkTsk.Name & ": PathPredecessor"
End If
If chkTsk.PathDrivingPredecessor Then
Debug.Print vbTab & chkTsk.Name & ": PathDrivingPredecessor"
End If
If chkTsk.PathSuccessor Then
Debug.Print vbTab & chkTsk.Name & ": PathSuccessor"
End If
If chkTsk.PathDrivenSuccessor Then
Debug.Print vbTab & chkTsk.Name & ": PathDrivenSuccessor"
End If
End If
Next chkTsk
End If
Next t
End Sub
Hi, @maibacherstr
You can refer to the following link, hope it can help you.
How to use VBA to create DAX measures automatically - YouTube
Best Regards,
Community Support Team _Charlotte
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
I found the following blog to contain a lot of promising code and instruction, but still believe this topic calls for practically expert-level skills.
TaskPathDrivingPredecessorFilter – TomsBlog (boyleprojectconsulting.com)
Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!
Check out the September 2025 Power BI update to learn about new features.
User | Count |
---|---|
9 | |
8 | |
7 | |
4 | |
3 |