<?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: Add values in a vertical way per product and determine week coverage in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Add-values-in-a-vertical-way-per-product-and-determine-week/m-p/2899259#M94371</link>
    <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="446728" data-lia-user-login="rod2k21" class="lia-mention lia-mention-user"&gt;rod2k21&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;
&lt;P&gt;I have created a simple sapmle, please refer to it to see if it helps you.&lt;/P&gt;
&lt;P&gt;Create measures.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;Measure =
VAR _1 =
    CALCULATE (
        MAX ( 'Table'[UnidadesInventario] ),
        FILTER (
            ALL ( 'Table' ),
            'Table'[insumos] = SELECTEDVALUE ( 'Table'[insumos] )
        )
    )
VAR _sum =
    CALCULATE (
        SUM ( 'Table'[consumo Sem] ),
        FILTER (
            ALL ( 'Table' ),
            'Table'[Sem] &amp;lt;= SELECTEDVALUE ( 'Table'[Sem] )
                &amp;amp;&amp;amp; 'Table'[insumos] = SELECTEDVALUE ( 'Table'[insumos] )
        )
    )
RETURN
    IF ( _sum &amp;lt;= _1, 1, 0 )
&lt;/LI-CODE&gt;&lt;LI-CODE lang="markup"&gt;result = COUNTAX(filter(ALL('Table'),'Table'[insumos]=SELECTEDVALUE('Table'[insumos])&amp;amp;&amp;amp;[Measure]=1),[Measure])&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;P&gt;Best Regards&lt;/P&gt;
&lt;P&gt;Community Support Team _ Polly&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;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Fri, 11 Nov 2022 06:13:19 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2022-11-11T06:13:19Z</dc:date>
    <item>
      <title>Add values in a vertical way per product and determine week coverage</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Add-values-in-a-vertical-way-per-product-and-determine-week/m-p/2898058#M94298</link>
      <description>&lt;P&gt;Hi experts!!&lt;/P&gt;&lt;P&gt;I need your assistance with the following please:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;As you can see, I have a single table with info on the products. &lt;U&gt;&lt;STRONG&gt;Requirement&lt;/STRONG&gt;&lt;/U&gt;: I need to create a measure or something to know how many weeks my inventory ("UnidadesInventario") can cover (considering consumption by week "Consumo Sem").&lt;/P&gt;&lt;P&gt;For example, Coca is covered for two weeks because we have 5 available units and we are consuming 1 in the first week and 4 in the second week, so the result for Coca with this data...would be: 2.&lt;/P&gt;&lt;P&gt;I've tried SUMX function, however, I think I need something else because I have to control the number of weeks (or rows) and add some conditional sentences...&lt;/P&gt;&lt;P&gt;Any ideas, tips, or even code to share?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks in advance.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 10 Nov 2022 17:09:15 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Add-values-in-a-vertical-way-per-product-and-determine-week/m-p/2898058#M94298</guid>
      <dc:creator>rod2k21</dc:creator>
      <dc:date>2022-11-10T17:09:15Z</dc:date>
    </item>
    <item>
      <title>Re: Add values in a vertical way per product and determine week coverage</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Add-values-in-a-vertical-way-per-product-and-determine-week/m-p/2898164#M94309</link>
      <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="446728" data-lia-user-login="rod2k21" class="lia-mention lia-mention-user"&gt;rod2k21&lt;/a&gt;&amp;nbsp;Not sure exactly what you want but it sounds like this:&amp;nbsp;&lt;A href="https://community.powerbi.com/t5/Quick-Measures-Gallery/Days-of-Supply/m-p/635656#M318" target="_blank"&gt;Days of Supply - Microsoft Power BI Community&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 10 Nov 2022 17:32:44 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Add-values-in-a-vertical-way-per-product-and-determine-week/m-p/2898164#M94309</guid>
      <dc:creator>Greg_Deckler</dc:creator>
      <dc:date>2022-11-10T17:32:44Z</dc:date>
    </item>
    <item>
      <title>Re: Add values in a vertical way per product and determine week coverage</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Add-values-in-a-vertical-way-per-product-and-determine-week/m-p/2899259#M94371</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="446728" data-lia-user-login="rod2k21" class="lia-mention lia-mention-user"&gt;rod2k21&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;
&lt;P&gt;I have created a simple sapmle, please refer to it to see if it helps you.&lt;/P&gt;
&lt;P&gt;Create measures.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;Measure =
VAR _1 =
    CALCULATE (
        MAX ( 'Table'[UnidadesInventario] ),
        FILTER (
            ALL ( 'Table' ),
            'Table'[insumos] = SELECTEDVALUE ( 'Table'[insumos] )
        )
    )
VAR _sum =
    CALCULATE (
        SUM ( 'Table'[consumo Sem] ),
        FILTER (
            ALL ( 'Table' ),
            'Table'[Sem] &amp;lt;= SELECTEDVALUE ( 'Table'[Sem] )
                &amp;amp;&amp;amp; 'Table'[insumos] = SELECTEDVALUE ( 'Table'[insumos] )
        )
    )
RETURN
    IF ( _sum &amp;lt;= _1, 1, 0 )
&lt;/LI-CODE&gt;&lt;LI-CODE lang="markup"&gt;result = COUNTAX(filter(ALL('Table'),'Table'[insumos]=SELECTEDVALUE('Table'[insumos])&amp;amp;&amp;amp;[Measure]=1),[Measure])&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;P&gt;Best Regards&lt;/P&gt;
&lt;P&gt;Community Support Team _ Polly&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;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 11 Nov 2022 06:13:19 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Add-values-in-a-vertical-way-per-product-and-determine-week/m-p/2899259#M94371</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2022-11-11T06:13:19Z</dc:date>
    </item>
    <item>
      <title>Re: Add values in a vertical way per product and determine week coverage</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Add-values-in-a-vertical-way-per-product-and-determine-week/m-p/2900503#M94451</link>
      <description>&lt;P&gt;Great, this is exactly what I needed! Thanks&amp;nbsp;Anonymous&lt;/a&gt;.&lt;/P&gt;</description>
      <pubDate>Fri, 11 Nov 2022 15:17:19 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Add-values-in-a-vertical-way-per-product-and-determine-week/m-p/2900503#M94451</guid>
      <dc:creator>rod2k19</dc:creator>
      <dc:date>2022-11-11T15:17:19Z</dc:date>
    </item>
    <item>
      <title>Re: Add values in a vertical way per product and determine week coverage</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Add-values-in-a-vertical-way-per-product-and-determine-week/m-p/2900508#M94452</link>
      <description>&lt;P&gt;Thanks&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="313" data-lia-user-login="Greg_Deckler" class="lia-mention lia-mention-user"&gt;Greg_Deckler&lt;/a&gt;&amp;nbsp;, great reference, it helps!&lt;/P&gt;</description>
      <pubDate>Fri, 11 Nov 2022 15:18:07 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Add-values-in-a-vertical-way-per-product-and-determine-week/m-p/2900508#M94452</guid>
      <dc:creator>rod2k19</dc:creator>
      <dc:date>2022-11-11T15:18:07Z</dc:date>
    </item>
  </channel>
</rss>

