<?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: Acumular el resultado de una medida  en otra medida por periodos in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Acumular-el-resultado-de-una-medida-en-otra-medida-por-periodos/m-p/2177826#M50667</link>
    <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="337300" data-lia-user-login="OGARCIAMX" class="lia-mention lia-mention-user"&gt;OGARCIAMX&lt;/a&gt; , On each month you want rolling 12 month data , if yes, you need to try like these &lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Rolling 12 = CALCULATE(sum(Sales[Sales Amount]),DATESINPERIOD('Date'[Date ],MAX('Date'[Date ]),-12,MONTH))&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Rolling 12 till last month= CALCULATE(sum(Sales[Sales Amount]),DATESINPERIOD('Date'[Date ]&lt;/P&gt;
&lt;P&gt;,eomonth(MAX('Date'[Date ]),-1) ,-12,MONTH))&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;In case you need 12 month by selecting a date , more dates than selected, you need an independent date table(Date1, used in slicer) with joined date table (Date)&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;sales =&lt;BR /&gt;var _max = maxx(allselected('Date1'),'Date1'[Date])&lt;BR /&gt;var _min = minx(allselected('Date1'),'Date1'[Date])&lt;BR /&gt;return&lt;BR /&gt;CALCULATE(SUM(Sales[Sales Amount]),filter(Date,Date[date] &amp;gt;=_Min &amp;amp;&amp;amp; date[date] &amp;lt;=_max))&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Independent Date Table:&lt;A href="https://www.youtube.com/watch?v=44fGGmg9fHI" target="_blank"&gt;https://www.youtube.com/watch?v=44fGGmg9fHI&lt;/A&gt;&lt;/P&gt;</description>
    <pubDate>Mon, 08 Nov 2021 10:53:31 GMT</pubDate>
    <dc:creator>amitchandak</dc:creator>
    <dc:date>2021-11-08T10:53:31Z</dc:date>
    <item>
      <title>Acumular el resultado de una medida  en otra medida por periodos</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Acumular-el-resultado-de-una-medida-en-otra-medida-por-periodos/m-p/2176235#M50613</link>
      <description>&lt;P&gt;Hola, soy principiante en el manejo de Power BI y tengo el siguiente detalle.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Tengo una medida que calcula la cartera [Cartera x Mes] y la presento por año mes en una tabla (funciona bien), y tengo una segunda medida [Carteraperiodos] en donde debo acumular los 12 meses anteriores de la cartera calculada por mes&amp;nbsp; y la presento tambien en la tabla pero el resultado es incorrecto ; si pruebo la medida que acumula con -1 mes, si respeta el valor del mes anterior, pero ya al acumular los demás meses, ya no coincide el resultado.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Agradecería me pudieran orientar en donde puede estar el problema, a continuación las dos medidas que utilizo.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;SPAN&gt;Cartera x Mes =&lt;/SPAN&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;DIV&gt;&lt;P&gt;var fechaselec =MAX('Calendario'[Date]) //fecha max por cada mes&lt;BR /&gt;var entrefechas=DATESBETWEEN(Calendario[Date],[_fechamin],[_fechamax])&lt;/P&gt;&lt;P&gt;var totalfacturado= Calculate(sum(Facturas[Factura_unicotipocambio]),entrefechas)&lt;/P&gt;&lt;P&gt;Var Cobrosxfecha=CALCULATE(SUM(Cobros[Cobros_unicotipocambio]),entrefechas,USERELATIONSHIP(Cobros[FechaEmision],Calendario[Date]))&lt;/P&gt;&lt;P&gt;var totalcartera=totalfacturado-Cobrosxfecha&lt;BR /&gt;return totalcartera&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;_CarteraPeriodos&lt;/STRONG&gt; =&lt;/P&gt;&lt;P&gt;var fechafinal=max(Calendario[Date])&lt;BR /&gt;var fechainicial=EDATE(fechafinal,-12)&lt;/P&gt;&lt;P&gt;var resultado= CALCULATE([Cartera x Mes],FILTER(ALL(Calendario), and(Calendario[Date] &amp;lt;= MAX(Calendario[Date]), calendario[date]&amp;gt;=fechainicial)))&lt;/P&gt;&lt;P&gt;return resultado&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;img /&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;/DIV&gt;</description>
      <pubDate>Sun, 07 Nov 2021 05:09:18 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Acumular-el-resultado-de-una-medida-en-otra-medida-por-periodos/m-p/2176235#M50613</guid>
      <dc:creator>OGARCIAMX</dc:creator>
      <dc:date>2021-11-07T05:09:18Z</dc:date>
    </item>
    <item>
      <title>Re: Acumular el resultado de una medida  en otra medida por periodos</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Acumular-el-resultado-de-una-medida-en-otra-medida-por-periodos/m-p/2177826#M50667</link>
      <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="337300" data-lia-user-login="OGARCIAMX" class="lia-mention lia-mention-user"&gt;OGARCIAMX&lt;/a&gt; , On each month you want rolling 12 month data , if yes, you need to try like these &lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Rolling 12 = CALCULATE(sum(Sales[Sales Amount]),DATESINPERIOD('Date'[Date ],MAX('Date'[Date ]),-12,MONTH))&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Rolling 12 till last month= CALCULATE(sum(Sales[Sales Amount]),DATESINPERIOD('Date'[Date ]&lt;/P&gt;
&lt;P&gt;,eomonth(MAX('Date'[Date ]),-1) ,-12,MONTH))&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;In case you need 12 month by selecting a date , more dates than selected, you need an independent date table(Date1, used in slicer) with joined date table (Date)&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;sales =&lt;BR /&gt;var _max = maxx(allselected('Date1'),'Date1'[Date])&lt;BR /&gt;var _min = minx(allselected('Date1'),'Date1'[Date])&lt;BR /&gt;return&lt;BR /&gt;CALCULATE(SUM(Sales[Sales Amount]),filter(Date,Date[date] &amp;gt;=_Min &amp;amp;&amp;amp; date[date] &amp;lt;=_max))&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Independent Date Table:&lt;A href="https://www.youtube.com/watch?v=44fGGmg9fHI" target="_blank"&gt;https://www.youtube.com/watch?v=44fGGmg9fHI&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 08 Nov 2021 10:53:31 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Acumular-el-resultado-de-una-medida-en-otra-medida-por-periodos/m-p/2177826#M50667</guid>
      <dc:creator>amitchandak</dc:creator>
      <dc:date>2021-11-08T10:53:31Z</dc:date>
    </item>
    <item>
      <title>Re: Acumular el resultado de una medida  en otra medida por periodos</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Acumular-el-resultado-de-una-medida-en-otra-medida-por-periodos/m-p/2178613#M50682</link>
      <description>&lt;H1&gt;&lt;SPAN class="lia-link-navigation lia-link-disabled"&gt;Hello &lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="148838" data-lia-user-login="amitchandak" class="lia-mention lia-mention-user"&gt;amitchandak&lt;/a&gt;, thank you very much for your support.&lt;/SPAN&gt;&lt;/H1&gt;&lt;P&gt;&lt;SPAN class="lia-link-navigation lia-link-disabled"&gt;I made a new measure with a second calendar table, but I still have the issue &lt;span class="lia-unicode-emoji" title=":disappointed_face:"&gt;😞&lt;/span&gt; , the result of the first measure [Cartera x mes] does not accumulate , this new measure gives me the same result per month.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="lia-link-navigation lia-link-disabled"&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;STRONG&gt;_12meses =&amp;nbsp; &amp;nbsp;//measure to accumulate [Cartera x Mes]&lt;/STRONG&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;var&lt;/SPAN&gt; &lt;SPAN&gt;_max&lt;/SPAN&gt;&lt;SPAN&gt; = &lt;/SPAN&gt;&lt;SPAN&gt;maxx&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;ALLSELECTED&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;'Duplicado Calendario'&lt;/SPAN&gt;&lt;SPAN&gt;),&lt;/SPAN&gt;&lt;SPAN&gt;'Duplicado Calendario'[Date]&lt;/SPAN&gt;&lt;SPAN&gt;)&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;var&lt;/SPAN&gt; &lt;SPAN&gt;_min&lt;/SPAN&gt;&lt;SPAN&gt; =&lt;/SPAN&gt;&lt;SPAN&gt;date&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;year&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;_max&lt;/SPAN&gt;&lt;SPAN&gt;),&lt;/SPAN&gt;&lt;SPAN&gt;month&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;_max&lt;/SPAN&gt;&lt;SPAN&gt;)-&lt;/SPAN&gt;&lt;SPAN&gt;12&lt;/SPAN&gt;&lt;SPAN&gt;,&lt;/SPAN&gt;&lt;SPAN&gt;1&lt;/SPAN&gt;&lt;SPAN&gt;)&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;return&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;calculate&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;STRONG&gt;[Cartera x Mes]&lt;/STRONG&gt;&lt;SPAN&gt;,&lt;/SPAN&gt;&lt;SPAN&gt;filter&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;Calendario&lt;/SPAN&gt;&lt;SPAN&gt;,&lt;/SPAN&gt;&lt;SPAN&gt;Calendario[Date]&lt;/SPAN&gt;&lt;SPAN&gt;&amp;lt;=&lt;/SPAN&gt;&lt;SPAN&gt;_max&lt;/SPAN&gt;&lt;SPAN&gt; &amp;amp;&amp;amp; &lt;/SPAN&gt;&lt;SPAN&gt;Calendario[Date]&lt;/SPAN&gt;&lt;SPAN&gt;&amp;gt;=&lt;/SPAN&gt;&lt;SPAN&gt;_min&lt;/SPAN&gt;&lt;SPAN&gt;))&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;P&gt;&lt;SPAN class="lia-link-navigation lia-link-disabled"&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="lia-link-navigation lia-link-disabled"&gt;This is an example of what it shoul be and the result i´m getting with the new measure.&lt;BR /&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;What could be the problem ?....&amp;nbsp;&lt;/P&gt;&lt;P&gt;Best regards.&lt;/P&gt;</description>
      <pubDate>Mon, 08 Nov 2021 17:03:37 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Acumular-el-resultado-de-una-medida-en-otra-medida-por-periodos/m-p/2178613#M50682</guid>
      <dc:creator>OGARCIAMX</dc:creator>
      <dc:date>2021-11-08T17:03:37Z</dc:date>
    </item>
    <item>
      <title>Re: Acumular el resultado de una medida  en otra medida por periodos</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Acumular-el-resultado-de-una-medida-en-otra-medida-por-periodos/m-p/2180239#M50725</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="337300" data-lia-user-login="OGARCIAMX" class="lia-mention lia-mention-user"&gt;OGARCIAMX&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;
&lt;P&gt;According to your description, I create a sample and it seems works fine with your formula. Is this your expected outcome?&lt;/P&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Here’s my sample, you can have a look. If it still not work, please provide me more details.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Best Regards,&lt;BR /&gt;Community Support Team _ kalyj&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>Tue, 09 Nov 2021 10:20:45 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Acumular-el-resultado-de-una-medida-en-otra-medida-por-periodos/m-p/2180239#M50725</guid>
      <dc:creator>v-yanjiang-msft</dc:creator>
      <dc:date>2021-11-09T10:20:45Z</dc:date>
    </item>
    <item>
      <title>Re: Acumular el resultado de una medida  en otra medida por periodos</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Acumular-el-resultado-de-una-medida-en-otra-medida-por-periodos/m-p/2181012#M50769</link>
      <description>&lt;P&gt;Hi, Thank you very much for your support, it was really helpful.&lt;/P&gt;&lt;P&gt;I used a&amp;nbsp;&lt;SPAN&gt;SUMMARIZECOLUMNS to store the totals and&amp;nbsp; then the Measure to sum periods and it worked.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Best regards.&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 09 Nov 2021 17:20:56 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Acumular-el-resultado-de-una-medida-en-otra-medida-por-periodos/m-p/2181012#M50769</guid>
      <dc:creator>OGARCIAMX</dc:creator>
      <dc:date>2021-11-09T17:20:56Z</dc:date>
    </item>
  </channel>
</rss>

