<?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: Adding conditional column with either value from other column OR the value from the row above in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Adding-conditional-column-with-either-value-from-other-column-OR/m-p/4003690#M156202</link>
    <description>&lt;P&gt;Hi&amp;nbsp;lbendlin, PowerQuery would be fine as wel!! I don't have any preferences and am already very happy that you are putting your time and effort in it&lt;/P&gt;</description>
    <pubDate>Fri, 21 Jun 2024 08:57:20 GMT</pubDate>
    <dc:creator>DanielB_NL</dc:creator>
    <dc:date>2024-06-21T08:57:20Z</dc:date>
    <item>
      <title>Adding conditional column with either value from other column OR the value from the row above</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Adding-conditional-column-with-either-value-from-other-column-OR/m-p/3994512#M155111</link>
      <description>&lt;P&gt;Hi All,&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm still trying to find my way in PowerBi and to solve some interesting questions, which I have.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have this query that generates the upper table: it put some expected mutations for a specific item no. in a time line and checks whether theoretticaly the stock is not sufficient. So this is nice, but now I want to see what my options are if the stock is not sufficient for the expected mutation:&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;If there is an expected Purchase Order due to arrive just before the mutation, I would like to know when and what amount: if I know which Purchase Order I can call the supplier to try to increase the ordered amount&lt;/LI&gt;&lt;LI&gt;If there is an&amp;nbsp;expected Purchase Order due to arrive just after the mutation, I would like to know when and what amount: if I know which Purchase Order I can call the supplier to try to get the items easlier.&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;Can someone tell me how to add such a conditional column? So for 'Previous_purchase' I would like to check if the column 'type' has the value 'Purchase' on the previous row and if so, I woulde like to get the Reference and put it in the column 'Previous_purchase'.&amp;nbsp;If the column 'type' has not the value 'Purchase' on the previous row, then I would like in&amp;nbsp;'Previous_purchase' to repeat the value of the previous row.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If I'm able to make such an overview, I only have to look at the row with the negative stock after mutation, and I can see directly which Purchase Order(s) are involved.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I hope you can help me out, thanks in advance!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;</description>
      <pubDate>Sat, 15 Jun 2024 21:50:51 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Adding-conditional-column-with-either-value-from-other-column-OR/m-p/3994512#M155111</guid>
      <dc:creator>DanielB_NL</dc:creator>
      <dc:date>2024-06-15T21:50:51Z</dc:date>
    </item>
    <item>
      <title>Re: Adding conditional column with either value from other column OR the value from the row above</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Adding-conditional-column-with-either-value-from-other-column-OR/m-p/3994548#M155116</link>
      <description>&lt;P&gt;There are a couple of tools at your disposal. Read about nested IFs, SWITCH, and COALESCE. Pick whatever you like best.&lt;/P&gt;</description>
      <pubDate>Sat, 15 Jun 2024 23:42:05 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Adding-conditional-column-with-either-value-from-other-column-OR/m-p/3994548#M155116</guid>
      <dc:creator>lbendlin</dc:creator>
      <dc:date>2024-06-15T23:42:05Z</dc:date>
    </item>
    <item>
      <title>Re: Adding conditional column with either value from other column OR the value from the row above</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Adding-conditional-column-with-either-value-from-other-column-OR/m-p/3994952#M155152</link>
      <description>&lt;P&gt;I'm working with swicht and nesteds IF's, but I guess I have to start with getting the value of 'reference' for the row direct after a Purchase row: I've tried and googled a while, and came up with the code below, but it's not working.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;previous_purchase = VAR CurrentRowType = Todays_future[type] VAR PreviousRowType = CALCULATE(MAX(Todays_future[type]), FILTER(ALL(Todays_future), Todays_future[index] = EARLIER(Todays_future[index]) - 1)) RETURN IF(CurrentRowType = "Purchase (PO)", Todays_future[reference], BLANK())&lt;/P&gt;</description>
      <pubDate>Sun, 16 Jun 2024 20:35:26 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Adding-conditional-column-with-either-value-from-other-column-OR/m-p/3994952#M155152</guid>
      <dc:creator>DanielB_NL</dc:creator>
      <dc:date>2024-06-16T20:35:26Z</dc:date>
    </item>
    <item>
      <title>Re: Adding conditional column with either value from other column OR the value from the row above</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Adding-conditional-column-with-either-value-from-other-column-OR/m-p/3994993#M155160</link>
      <description>&lt;P&gt;Try not to use EARLIER.&amp;nbsp; Use variables instead.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Please provide sample data that covers your issue or question &lt;STRONG&gt;completely&lt;/STRONG&gt;, in a &lt;STRONG&gt;usable&lt;/STRONG&gt; format (not as a screenshot).&lt;BR /&gt;&lt;BR /&gt;Do not include sensitive information or anything not related to the issue or question. &lt;BR /&gt;&lt;BR /&gt;If you are unsure how to upload data please refer to &lt;A href="https://community.fabric.microsoft.com/t5/Community-Blog/How-to-provide-sample-data-in-the-Power-BI-Forum/ba-p/963216" target="_blank"&gt;https://community.fabric.microsoft.com/t5/Community-Blog/How-to-provide-sample-data-in-the-Power-BI-Forum/ba-p/963216&lt;/A&gt; &lt;BR /&gt;&lt;BR /&gt;Please show the expected outcome based on the sample data you provided. &lt;BR /&gt;&lt;BR /&gt;Want faster answers? &lt;A href="https://community.fabric.microsoft.com/t5/Desktop/How-to-Get-Your-Question-Answered-Quickly/m-p/1447523" target="_blank"&gt;https://community.fabric.microsoft.com/t5/Desktop/How-to-Get-Your-Question-Answered-Quickly/m-p/1447523&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 17 Jun 2024 00:02:56 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Adding-conditional-column-with-either-value-from-other-column-OR/m-p/3994993#M155160</guid>
      <dc:creator>lbendlin</dc:creator>
      <dc:date>2024-06-17T00:02:56Z</dc:date>
    </item>
    <item>
      <title>Re: Adding conditional column with either value from other column OR the value from the row above</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Adding-conditional-column-with-either-value-from-other-column-OR/m-p/3996328#M155279</link>
      <description>&lt;P&gt;Hi, thank you for the swift reaction. Variables is competely new to me, so I really hope you can help me a little further. I've created a small dataset in an CSV-file and made it available from my Dropbox account:&lt;/P&gt;&lt;P&gt;&lt;A href="https://www.dropbox.com/scl/fi/rfa20o4q1uq157ha9gdwg/use_case_PowerBI_data.csv?rlkey=i2x9ag9asd99m0g4pdmc29cb4&amp;amp;st=uh2gnb5o" target="_self"&gt;https://www.dropbox.com/scl/fi/rfa20o4q1uq157ha9gdwg/use_case_PowerBI_data.csv?rlkey=i2x9ag9asd99m0g4pdmc29cb4&amp;amp;st=uh2gnb5o&lt;/A&gt;&lt;/P&gt;&lt;P&gt;I've created an Excelsheet with the desired results:&lt;/P&gt;&lt;P&gt;&lt;A href="https://www.dropbox.com/scl/fi/ufdqndnkkoozuqcesk79x/use_case_PowerBI_desired_result.xlsx?rlkey=yfeo19f19xdxy6tlnepez8t80&amp;amp;st=tz7ym6gq" target="_self"&gt;https://www.dropbox.com/scl/fi/ufdqndnkkoozuqcesk79x/use_case_PowerBI_desired_result.xlsx?rlkey=yfeo19f19xdxy6tlnepez8t80&amp;amp;st=tz7ym6gq&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If I have the extra columns, in my Dashboard I can filter on rows that have in the column 'Stock_after_booking' a value &amp;lt; 0. By doing this I isolate all my project which have a potential problem and I also see which Purchase Orders I can try to influence in order to solve the problem.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I really hope you can help me with this, thanks in advance for your reply!&lt;/P&gt;&lt;P&gt;Kind regards, Daniel&lt;/P&gt;</description>
      <pubDate>Mon, 17 Jun 2024 14:27:47 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Adding-conditional-column-with-either-value-from-other-column-OR/m-p/3996328#M155279</guid>
      <dc:creator>DanielB_NL</dc:creator>
      <dc:date>2024-06-17T14:27:47Z</dc:date>
    </item>
    <item>
      <title>Re: Adding conditional column with either value from other column OR the value from the row above</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Adding-conditional-column-with-either-value-from-other-column-OR/m-p/4002873#M156122</link>
      <description>&lt;P&gt;Thank you for the sample data. Looking at it I don't see any fields that would be impacted by user filter choices.&amp;nbsp; As such the new columns could be added in Power Query instead of DAX. Do you have any preferences?&lt;/P&gt;</description>
      <pubDate>Thu, 20 Jun 2024 23:01:58 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Adding-conditional-column-with-either-value-from-other-column-OR/m-p/4002873#M156122</guid>
      <dc:creator>lbendlin</dc:creator>
      <dc:date>2024-06-20T23:01:58Z</dc:date>
    </item>
    <item>
      <title>Re: Adding conditional column with either value from other column OR the value from the row above</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Adding-conditional-column-with-either-value-from-other-column-OR/m-p/4003690#M156202</link>
      <description>&lt;P&gt;Hi&amp;nbsp;lbendlin, PowerQuery would be fine as wel!! I don't have any preferences and am already very happy that you are putting your time and effort in it&lt;/P&gt;</description>
      <pubDate>Fri, 21 Jun 2024 08:57:20 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Adding-conditional-column-with-either-value-from-other-column-OR/m-p/4003690#M156202</guid>
      <dc:creator>DanielB_NL</dc:creator>
      <dc:date>2024-06-21T08:57:20Z</dc:date>
    </item>
    <item>
      <title>Re: Adding conditional column with either value from other column OR the value from the row above</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Adding-conditional-column-with-either-value-from-other-column-OR/m-p/4005807#M156704</link>
      <description>&lt;P&gt;&lt;SPAN&gt;Hi&amp;nbsp;lbendlin, I've extended the dataset with 2 more article numbers: the idea that the stock mutations over time are evaluated per article number, but after looking at the sample data again I wasn't sure that this was clear with the limited data sample. I think it is more clear this way.&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Sun, 23 Jun 2024 21:48:04 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Adding-conditional-column-with-either-value-from-other-column-OR/m-p/4005807#M156704</guid>
      <dc:creator>DanielB_NL</dc:creator>
      <dc:date>2024-06-23T21:48:04Z</dc:date>
    </item>
    <item>
      <title>Re: Adding conditional column with either value from other column OR the value from the row above</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Adding-conditional-column-with-either-value-from-other-column-OR/m-p/4028935#M159221</link>
      <description>&lt;P&gt;I'm a bit lost as to what you are trying to achieve. Are you trying to predict when you run out of stock?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;P&gt;Your sample data may not be sufficient for the scenario.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 07 Jul 2024 21:21:23 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Adding-conditional-column-with-either-value-from-other-column-OR/m-p/4028935#M159221</guid>
      <dc:creator>lbendlin</dc:creator>
      <dc:date>2024-07-07T21:21:23Z</dc:date>
    </item>
    <item>
      <title>Re: Adding conditional column with either value from other column OR the value from the row above</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Adding-conditional-column-with-either-value-from-other-column-OR/m-p/4028945#M159222</link>
      <description>&lt;P&gt;Yes I am. We have 4 types of mutations that influence the stock level:&lt;/P&gt;&lt;OL&gt;&lt;LI&gt;Purchase: receiving purchase orders&lt;/LI&gt;&lt;LI&gt;Production: our own production from our shop factory&lt;/LI&gt;&lt;LI&gt;Sales: sales via our Service Deparment&lt;/LI&gt;&lt;LI&gt;Project: Usage on projects that are being assembled&lt;/LI&gt;&lt;/OL&gt;&lt;P&gt;My idea is&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;That mutations are done in planned order, so I can put them ordered by date and see how stock fluctuates&lt;/LI&gt;&lt;LI&gt;For mutations of type 3 and 4 there is a problem if after the mutation stock is below zero (of before the mutation, the mutation amount is bigger than the stock level)&lt;/LI&gt;&lt;LI&gt;I want our Purchase Department to react and my first impression is that I can have up to 2 possibilities:&lt;UL&gt;&lt;LI&gt;If there is a purchase reception planned before the expected stock shortage: I can try to ask the supplier to increase the amount on that Purchase Order, but I need to now which Purchase Order I need to look at&lt;/LI&gt;&lt;LI&gt;If there is a purchase reception planned after the expected stock shortage: I can try to ask the supplier to deliver earlier, but also for this goes that I need to know which Purchase Order to look at.&lt;/LI&gt;&lt;LI&gt;Also for the Purchase reception that is planned after the expected stock shortage: if the difference in dates is less than or equal to 7 days, I can neglect them because for me that is still acceptable and not worth the effort to get the delivery a few days faster.&lt;/LI&gt;&lt;/UL&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;I hope you have an idea now of what I try to achieve&lt;/P&gt;</description>
      <pubDate>Sun, 07 Jul 2024 21:35:45 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Adding-conditional-column-with-either-value-from-other-column-OR/m-p/4028945#M159222</guid>
      <dc:creator>DanielB_NL</dc:creator>
      <dc:date>2024-07-07T21:35:45Z</dc:date>
    </item>
    <item>
      <title>Re: Adding conditional column with either value from other column OR the value from the row above</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Adding-conditional-column-with-either-value-from-other-column-OR/m-p/4063538#M161310</link>
      <description>&lt;P&gt;Hi&amp;nbsp;lbendlin, can you tell me whether it is technically possible? Or do I need more, additional data? I'm still hoping you can help me out.&lt;/P&gt;</description>
      <pubDate>Fri, 26 Jul 2024 10:04:01 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Adding-conditional-column-with-either-value-from-other-column-OR/m-p/4063538#M161310</guid>
      <dc:creator>DanielB_NL</dc:creator>
      <dc:date>2024-07-26T10:04:01Z</dc:date>
    </item>
    <item>
      <title>Re: Adding conditional column with either value from other column OR the value from the row above</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Adding-conditional-column-with-either-value-from-other-column-OR/m-p/4064422#M161360</link>
      <description>&lt;P&gt;Keep in mind that Power BI is a reporting tool, not a stock/inventory management application. May want to use a proper app.&lt;/P&gt;</description>
      <pubDate>Fri, 26 Jul 2024 20:38:38 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Adding-conditional-column-with-either-value-from-other-column-OR/m-p/4064422#M161360</guid>
      <dc:creator>lbendlin</dc:creator>
      <dc:date>2024-07-26T20:38:38Z</dc:date>
    </item>
  </channel>
</rss>

