<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: DAX HEROES NEEDED: Re-writing VBA into a Measure (MS Project: Task.PathDrivingPredecessor) in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DAX-HEROES-NEEDED-Re-writing-VBA-into-a-Measure-MS-Project-Task/m-p/2534735#M71205</link>
    <description>&lt;P&gt;Hi,&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="284147" data-lia-user-login="maibacherstr" class="lia-mention lia-mention-user"&gt;maibacherstr&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You can refer to the following link, hope it can help you.&lt;/P&gt;
&lt;P&gt;&lt;A href="https://www.youtube.com/watch?v=Ai4CspZ-SG4" target="_blank"&gt;How to use VBA to create DAX measures automatically - YouTube&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Best Regards,&lt;/P&gt;
&lt;P&gt;Community Support Team _Charlotte&lt;/P&gt;
&lt;P&gt;If this post &lt;STRONG&gt;helps&lt;/STRONG&gt;, then please consider &lt;STRONG&gt;&lt;EM&gt;Accept it as the solution&lt;/EM&gt;&lt;/STRONG&gt; to help the other members find it more quickly.&lt;/P&gt;</description>
    <pubDate>Tue, 24 May 2022 02:22:00 GMT</pubDate>
    <dc:creator>v-zhangti</dc:creator>
    <dc:date>2022-05-24T02:22:00Z</dc:date>
    <item>
      <title>DAX HEROES NEEDED: Re-writing VBA into a Measure (MS Project: Task.PathDrivingPredecessor)</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DAX-HEROES-NEEDED-Re-writing-VBA-into-a-Measure-MS-Project-Task/m-p/2527006#M70687</link>
      <description>&lt;P&gt;Hello Power BI Community,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;There is a potent but little-known feature in MS Project known as &lt;A href="https://docs.microsoft.com/en-us/office/vba/api/Project.task.pathdrivingpredecessor" target="_self"&gt;Task.PathDrivingPredecessor,&lt;/A&gt; which according to MSFT documentation "g&lt;SPAN&gt;ets a value that indicates whether the task is a predecessor that drives the selected task, when the&amp;nbsp;&lt;/SPAN&gt;&lt;STRONG&gt;Driving Predecessors&lt;/STRONG&gt;&lt;SPAN&gt;&amp;nbsp;item is selected in the&amp;nbsp;&lt;/SPAN&gt;&lt;STRONG&gt;Task Path&lt;/STRONG&gt;&lt;SPAN&gt;&amp;nbsp;drop-down list. Read-only&amp;nbsp;&lt;/SPAN&gt;&lt;STRONG&gt;Boolean&lt;/STRONG&gt;&lt;SPAN&gt;."&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;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.&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&lt;STRONG&gt;However, the VBA is not simple&lt;/STRONG&gt;. 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.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;This might need the heroes' attention. Go ahead, be a hero! Thank you in advance.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Option Explicit&lt;/P&gt;&lt;P&gt;Sub TestTaskPath()&lt;BR /&gt;Dim t As Task&lt;BR /&gt;Dim chkTsk As Task&lt;BR /&gt;Dim selectedTaskId As Integer&lt;BR /&gt;&lt;BR /&gt;For Each t In ActiveProject.Tasks&lt;BR /&gt;selectedTaskId = t.ID&lt;BR /&gt;Application.SelectRow Row:=selectedTaskId, RowRelative:=False&lt;BR /&gt;&lt;BR /&gt;If Not (ActiveSelection.Tasks Is Nothing) Then&lt;BR /&gt;Debug.Print&lt;BR /&gt;&lt;BR /&gt;With ActiveSelection.Tasks(1)&lt;BR /&gt;Debug.Print "Selected task ID " &amp;amp; .UniqueID &amp;amp; ", name: " &amp;amp; .Name&lt;BR /&gt;End With&lt;BR /&gt;&lt;BR /&gt;For Each chkTsk In ActiveProject.Tasks&lt;BR /&gt;If Not (chkTsk.ID = selectedTaskId) Then&lt;BR /&gt;If chkTsk.PathPredecessor Then&lt;BR /&gt;Debug.Print vbTab &amp;amp; chkTsk.Name &amp;amp; ": PathPredecessor"&lt;BR /&gt;End If&lt;BR /&gt;If chkTsk.PathDrivingPredecessor Then&lt;BR /&gt;Debug.Print vbTab &amp;amp; chkTsk.Name &amp;amp; ": PathDrivingPredecessor"&lt;BR /&gt;End If&lt;BR /&gt;If chkTsk.PathSuccessor Then&lt;BR /&gt;Debug.Print vbTab &amp;amp; chkTsk.Name &amp;amp; ": PathSuccessor"&lt;BR /&gt;End If&lt;BR /&gt;If chkTsk.PathDrivenSuccessor Then&lt;BR /&gt;Debug.Print vbTab &amp;amp; chkTsk.Name &amp;amp; ": PathDrivenSuccessor"&lt;BR /&gt;End If&lt;BR /&gt;End If&lt;BR /&gt;Next chkTsk&lt;BR /&gt;End If&lt;BR /&gt;Next t&lt;BR /&gt;End Sub&lt;/P&gt;</description>
      <pubDate>Thu, 19 May 2022 15:06:15 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DAX-HEROES-NEEDED-Re-writing-VBA-into-a-Measure-MS-Project-Task/m-p/2527006#M70687</guid>
      <dc:creator>maibacherstr</dc:creator>
      <dc:date>2022-05-19T15:06:15Z</dc:date>
    </item>
    <item>
      <title>Re: DAX HEROES NEEDED: Re-writing VBA into a Measure (MS Project: Task.PathDrivingPredecessor)</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DAX-HEROES-NEEDED-Re-writing-VBA-into-a-Measure-MS-Project-Task/m-p/2527035#M70693</link>
      <description>&lt;P&gt;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.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;A href="https://boyleprojectconsulting.com/TomsBlog/tag/taskpathdrivingpredecessorfilter/" target="_blank"&gt;TaskPathDrivingPredecessorFilter – TomsBlog (boyleprojectconsulting.com)&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 19 May 2022 15:18:36 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DAX-HEROES-NEEDED-Re-writing-VBA-into-a-Measure-MS-Project-Task/m-p/2527035#M70693</guid>
      <dc:creator>maibacherstr</dc:creator>
      <dc:date>2022-05-19T15:18:36Z</dc:date>
    </item>
    <item>
      <title>Re: DAX HEROES NEEDED: Re-writing VBA into a Measure (MS Project: Task.PathDrivingPredecessor)</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DAX-HEROES-NEEDED-Re-writing-VBA-into-a-Measure-MS-Project-Task/m-p/2534735#M71205</link>
      <description>&lt;P&gt;Hi,&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="284147" data-lia-user-login="maibacherstr" class="lia-mention lia-mention-user"&gt;maibacherstr&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You can refer to the following link, hope it can help you.&lt;/P&gt;
&lt;P&gt;&lt;A href="https://www.youtube.com/watch?v=Ai4CspZ-SG4" target="_blank"&gt;How to use VBA to create DAX measures automatically - YouTube&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Best Regards,&lt;/P&gt;
&lt;P&gt;Community Support Team _Charlotte&lt;/P&gt;
&lt;P&gt;If this post &lt;STRONG&gt;helps&lt;/STRONG&gt;, then please consider &lt;STRONG&gt;&lt;EM&gt;Accept it as the solution&lt;/EM&gt;&lt;/STRONG&gt; to help the other members find it more quickly.&lt;/P&gt;</description>
      <pubDate>Tue, 24 May 2022 02:22:00 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DAX-HEROES-NEEDED-Re-writing-VBA-into-a-Measure-MS-Project-Task/m-p/2534735#M71205</guid>
      <dc:creator>v-zhangti</dc:creator>
      <dc:date>2022-05-24T02:22:00Z</dc:date>
    </item>
  </channel>
</rss>

