<?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: For looping in DAX to calculate starting dates according to end dates of tasks in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/For-looping-in-DAX-to-calculate-starting-dates-according-to-end/m-p/2072708#M46904</link>
    <description>&lt;P&gt;Please refer to the picture above:&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Operation1 doesn't have any prerequisite so it should take the starting date of the project that I've introduced as a measure.&amp;nbsp;&lt;/P&gt;&lt;P&gt;Operation 2 has one prerequisite (which is operation 1) should start at the end of operation 1. It ends at end of operation 1 +duration of operation 2&amp;nbsp;&lt;/P&gt;&lt;P&gt;Same thing for operation 3 it follows operation 2 so it shoul start at the end date of operation 2 and it will finish 3 days after because the&amp;nbsp; execution of operation takes 21 hours (8 working hours a day)&lt;/P&gt;&lt;P&gt;....&lt;/P&gt;&lt;P&gt;operation 11 has two prerequisites 9 and 10, so its starting date will be the max finish date of 9 and 10.&lt;/P&gt;</description>
    <pubDate>Mon, 13 Sep 2021 11:34:14 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2021-09-13T11:34:14Z</dc:date>
    <item>
      <title>For looping in DAX to calculate starting dates according to end dates of tasks</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/For-looping-in-DAX-to-calculate-starting-dates-according-to-end/m-p/2069191#M46803</link>
      <description>&lt;P&gt;Hello community,&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm trying to build a GANTT view in my Power BI Report using tasks durations and prerequisites. I need to calculate the starting date of an operation according to the end date of its prerequisites (that is not usually unique). You can find below the content of my table:&lt;/P&gt;&lt;P&gt;I set up a starting date of the first task to 1 september using the DAX code :&amp;nbsp;&lt;/P&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;start = IF(Jointure[bool]=="vrai";[debutprojet])&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;Then I calculated the end date using this formula :&amp;nbsp;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;end = Jointure[start]+(Jointure[duree_operation]/8)&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;I tried the following formula for calculating the remaining start dates : &lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;start = IF(Jointure[bool]=="vrai";[debutprojet];LOOKUPVALUE(Jointure[end];Jointure[operationID];Jointure[prerequisID]))&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;Unfortunatly, a circular dependency wad detected.&amp;nbsp;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;How can I loop 2 times through operationsID and prerequisites to find at each iteration the maximum value of an operation prerequisites end date ?&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;Thanks for your help !&amp;nbsp;&lt;/DIV&gt;&lt;/DIV&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 10 Sep 2021 14:38:04 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/For-looping-in-DAX-to-calculate-starting-dates-according-to-end/m-p/2069191#M46803</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2021-09-10T14:38:04Z</dc:date>
    </item>
    <item>
      <title>Re: For looping in DAX to calculate starting dates according to end dates of tasks</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/For-looping-in-DAX-to-calculate-starting-dates-according-to-end/m-p/2069211#M46804</link>
      <description>&lt;P&gt;Anonymous&lt;/LI-USER&gt;&amp;nbsp;Well, you can do emulated FOR and WHILE loops in DAX.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;A href="https://community.powerbi.com/t5/Quick-Measures-Gallery/For-Loop/m-p/637531#M319" target="_blank"&gt;https://community.powerbi.com/t5/Quick-Measures-Gallery/For-Loop/m-p/637531#M319&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&lt;A href="https://community.powerbi.com/t5/Quick-Measures-Gallery/While-Loop/m-p/637535#M320" target="_blank"&gt;https://community.powerbi.com/t5/Quick-Measures-Gallery/While-Loop/m-p/637535#M320&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;Recursion or previous value is very difficult&lt;/P&gt;
&lt;P&gt;&lt;A href="https://community.powerbi.com/t5/Quick-Measures-Gallery/Previous-Value-aka-quot-Recursion-quot/m-p/637614#M321" target="_blank"&gt;https://community.powerbi.com/t5/Quick-Measures-Gallery/Previous-Value-aka-quot-Recursion-quot/m-p/637614#M321&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;However, I'm not sure exactly what you want. Can you post sample data as text and expected output?&lt;/P&gt;</description>
      <pubDate>Fri, 10 Sep 2021 14:49:59 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/For-looping-in-DAX-to-calculate-starting-dates-according-to-end/m-p/2069211#M46804</guid>
      <dc:creator>Greg_Deckler</dc:creator>
      <dc:date>2021-09-10T14:49:59Z</dc:date>
    </item>
    <item>
      <title>Re: For looping in DAX to calculate starting dates according to end dates of tasks</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/For-looping-in-DAX-to-calculate-starting-dates-according-to-end/m-p/2072708#M46904</link>
      <description>&lt;P&gt;Please refer to the picture above:&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Operation1 doesn't have any prerequisite so it should take the starting date of the project that I've introduced as a measure.&amp;nbsp;&lt;/P&gt;&lt;P&gt;Operation 2 has one prerequisite (which is operation 1) should start at the end of operation 1. It ends at end of operation 1 +duration of operation 2&amp;nbsp;&lt;/P&gt;&lt;P&gt;Same thing for operation 3 it follows operation 2 so it shoul start at the end date of operation 2 and it will finish 3 days after because the&amp;nbsp; execution of operation takes 21 hours (8 working hours a day)&lt;/P&gt;&lt;P&gt;....&lt;/P&gt;&lt;P&gt;operation 11 has two prerequisites 9 and 10, so its starting date will be the max finish date of 9 and 10.&lt;/P&gt;</description>
      <pubDate>Mon, 13 Sep 2021 11:34:14 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/For-looping-in-DAX-to-calculate-starting-dates-according-to-end/m-p/2072708#M46904</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2021-09-13T11:34:14Z</dc:date>
    </item>
  </channel>
</rss>

