<?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: Is it possible to solve this problem with DAX? in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Is-it-possible-to-solve-this-problem-with-DAX/m-p/2522651#M70420</link>
    <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="219728" data-lia-user-login="sashaxiv" class="lia-mention lia-mention-user"&gt;sashaxiv&lt;/a&gt;&amp;nbsp;,&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I think your calculate logic contains looping. As far as I know, dax doesn't support looping currently.&amp;nbsp; Here I suggest to try to Power Query.&lt;/P&gt;
&lt;P&gt;Here I suggest you to try List.Generate function.&lt;/P&gt;
&lt;P&gt;For reference:&amp;nbsp;&lt;A href="https://gorilla.bi/power-query/list-generate/" target="_self"&gt;List.Generate in Power Query: Tutorial with Easy Examples&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&lt;A href="https://community.powerbi.com/t5/Community-Blog/Accumulative-conditional-accumulative-in-Power-Query/ba-p/2332669" target="_self"&gt;Accumulative, conditional accumulative in Power Query &lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Best Regards,&lt;BR /&gt;Rico Zhou&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.&lt;/P&gt;</description>
    <pubDate>Wed, 18 May 2022 08:33:14 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2022-05-18T08:33:14Z</dc:date>
    <item>
      <title>Is it possible to solve this problem with DAX?</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Is-it-possible-to-solve-this-problem-with-DAX/m-p/2502353#M69203</link>
      <description>&lt;P&gt;Morning All!&lt;/P&gt;&lt;P&gt;I was wondering if it would be possible to solve with Dax a problem like this:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;I have a table of stores and their limits.&lt;/LI&gt;&lt;LI&gt;I have a table of boxes to be assigned to the stores&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;Any ideas to define a column "GiveTo" that assigns boxes to stores?&amp;nbsp;&lt;/P&gt;&lt;TABLE&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;ID&lt;/TD&gt;&lt;TD&gt;Limit&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;TD&gt;Id&lt;/TD&gt;&lt;TD&gt;Units&lt;/TD&gt;&lt;TD&gt;&lt;FONT color="#FF9900"&gt;GiveTo&lt;/FONT&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;Store 1&lt;/TD&gt;&lt;TD&gt;500&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;TD&gt;Box 1&lt;/TD&gt;&lt;TD&gt;100&lt;/TD&gt;&lt;TD&gt;Store 1&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;Store 2&lt;/TD&gt;&lt;TD&gt;400&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;TD&gt;Box 2&lt;/TD&gt;&lt;TD&gt;300&lt;/TD&gt;&lt;TD&gt;Store 1&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;Store 3&amp;nbsp;&lt;/TD&gt;&lt;TD&gt;300&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;TD&gt;Box 3&lt;/TD&gt;&lt;TD&gt;200&lt;/TD&gt;&lt;TD&gt;Store2&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;TD&gt;Box 4&lt;/TD&gt;&lt;TD&gt;200&lt;/TD&gt;&lt;TD&gt;Store2&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;TD&gt;Box 5&lt;/TD&gt;&lt;TD&gt;100&lt;/TD&gt;&lt;TD&gt;Store 3&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;It would be easy to solve this&amp;nbsp; in Java/C...... ( While assigned&amp;lt;limit do sth...), but what about DAX?&lt;/P&gt;&lt;P&gt;Thanks in advance!&lt;/P&gt;</description>
      <pubDate>Mon, 09 May 2022 14:33:02 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Is-it-possible-to-solve-this-problem-with-DAX/m-p/2502353#M69203</guid>
      <dc:creator>sashaxiv</dc:creator>
      <dc:date>2022-05-09T14:33:02Z</dc:date>
    </item>
    <item>
      <title>Re: Is it possible to solve this problem with DAX?</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Is-it-possible-to-solve-this-problem-with-DAX/m-p/2502370#M69205</link>
      <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="219728" data-lia-user-login="sashaxiv" class="lia-mention lia-mention-user"&gt;sashaxiv&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;&lt;P&gt;It is possible, based on what condition do you need to define the column?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Arul&lt;/P&gt;</description>
      <pubDate>Mon, 09 May 2022 14:39:40 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Is-it-possible-to-solve-this-problem-with-DAX/m-p/2502370#M69205</guid>
      <dc:creator>Arul</dc:creator>
      <dc:date>2022-05-09T14:39:40Z</dc:date>
    </item>
    <item>
      <title>Re: Is it possible to solve this problem with DAX?</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Is-it-possible-to-solve-this-problem-with-DAX/m-p/2502401#M69207</link>
      <description>&lt;P&gt;On the limit. For example, store 1 has a limit of 500. Boxes can be assigned to store1 if the sum of units of all assigned boxes is less than 500.&lt;/P&gt;</description>
      <pubDate>Mon, 09 May 2022 14:44:21 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Is-it-possible-to-solve-this-problem-with-DAX/m-p/2502401#M69207</guid>
      <dc:creator>sashaxiv</dc:creator>
      <dc:date>2022-05-09T14:44:21Z</dc:date>
    </item>
    <item>
      <title>Re: Is it possible to solve this problem with DAX?</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Is-it-possible-to-solve-this-problem-with-DAX/m-p/2502438#M69210</link>
      <description>&lt;P&gt;You'd need an index column or similar on both tables, to define the precedence of the stores and the order in which the boxes should be given out.&lt;/P&gt;&lt;P&gt;Then you could create a helper table like&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;Store limits = ADDCOLUMNS( SUMMARIZE( 'Table1', 'Table1'[Index], 'Table1'[Store]), "Upper bound",
var currentIndex = SELECTEDVALUE( 'Table1'[Index])
return CALCULATE( SUM('Table1'[Limit]), 'Table1'[Index] &amp;lt;= currentIndex)
)&lt;/LI-CODE&gt;&lt;P&gt;and you could add a new column to the other table like&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;Give to store =
var currentIndex = 'Table2'[Index]
var totalUnits = CALCULATE( SUM('Table2'[Units]), 'Table2'[Index] &amp;lt;= currentIndex)
var summaryTable = TOPN(1, FILTER('Store limits', 'Store limits[Upper bound] &amp;gt;= totalUnits), 'Store limits'[Index], ASC)
return SELECTCOLUMNS( summaryTable, "@val", [Store])&lt;/LI-CODE&gt;</description>
      <pubDate>Mon, 09 May 2022 14:55:33 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Is-it-possible-to-solve-this-problem-with-DAX/m-p/2502438#M69210</guid>
      <dc:creator>johnt75</dc:creator>
      <dc:date>2022-05-09T14:55:33Z</dc:date>
    </item>
    <item>
      <title>Re: Is it possible to solve this problem with DAX?</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Is-it-possible-to-solve-this-problem-with-DAX/m-p/2522651#M70420</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="219728" data-lia-user-login="sashaxiv" class="lia-mention lia-mention-user"&gt;sashaxiv&lt;/a&gt;&amp;nbsp;,&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I think your calculate logic contains looping. As far as I know, dax doesn't support looping currently.&amp;nbsp; Here I suggest to try to Power Query.&lt;/P&gt;
&lt;P&gt;Here I suggest you to try List.Generate function.&lt;/P&gt;
&lt;P&gt;For reference:&amp;nbsp;&lt;A href="https://gorilla.bi/power-query/list-generate/" target="_self"&gt;List.Generate in Power Query: Tutorial with Easy Examples&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&lt;A href="https://community.powerbi.com/t5/Community-Blog/Accumulative-conditional-accumulative-in-Power-Query/ba-p/2332669" target="_self"&gt;Accumulative, conditional accumulative in Power Query &lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Best Regards,&lt;BR /&gt;Rico Zhou&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.&lt;/P&gt;</description>
      <pubDate>Wed, 18 May 2022 08:33:14 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Is-it-possible-to-solve-this-problem-with-DAX/m-p/2522651#M70420</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2022-05-18T08:33:14Z</dc:date>
    </item>
  </channel>
</rss>

