<?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: Extract last data from a month in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Extract-last-data-from-a-month/m-p/875611#M7342</link>
    <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="82403" data-lia-user-login="az38" class="lia-mention lia-mention-user"&gt;az38&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have a data base with weekly sales and inventory. I&amp;nbsp;can accumulate the sales during the year, but the inventory is the current state of stock in each week ( so the inventory of the month is the inventory of the last week of the month with data ).&lt;/P&gt;&lt;P&gt;I need a measure ( i suppose), that gives me the last week of inventory when i use each month in a visualization.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Sun, 15 Dec 2019 19:22:01 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2019-12-15T19:22:01Z</dc:date>
    <item>
      <title>Extract last data from a month</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Extract-last-data-from-a-month/m-p/875477#M7336</link>
      <description>&lt;P&gt;Hello everyone,&lt;/P&gt;&lt;P&gt;I have this table and i just want to extract the last inventory of each month, i've been trying without succesfull results. I'd really appreciate some help:&lt;/P&gt;&lt;DIV class="mceNonEditable lia-copypaste-placeholder"&gt;&amp;nbsp;&lt;/DIV&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;The expected result is as follows:&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;Thank you&lt;/P&gt;</description>
      <pubDate>Sun, 15 Dec 2019 02:58:29 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Extract-last-data-from-a-month/m-p/875477#M7336</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2019-12-15T02:58:29Z</dc:date>
    </item>
    <item>
      <title>Re: Extract last data from a month</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Extract-last-data-from-a-month/m-p/875588#M7339</link>
      <description>&lt;P&gt;Hi&amp;nbsp;Anonymous&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;try create a new table&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;NewTable = summarize(Table;Table[Data].[Month];"lastinventory";LASTNONBLANK(Table[Inventario];1))&lt;/LI-CODE&gt;&lt;P&gt;or&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;NewTable = summarize(Table;Table[Data].[MonthNo];"lastinventory";LASTNONBLANK(Table[Inventario];1))&lt;/LI-CODE&gt;&lt;P&gt;&lt;STRONG&gt;&lt;I&gt;&lt;FONT color="#ababab"&gt;do not hesitate to give a kudo to useful posts and mark solutions as solution&lt;/FONT&gt;&lt;/I&gt;&lt;/STRONG&gt;&lt;/P&gt;</description>
      <pubDate>Sun, 15 Dec 2019 16:05:51 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Extract-last-data-from-a-month/m-p/875588#M7339</guid>
      <dc:creator>az38</dc:creator>
      <dc:date>2019-12-15T16:05:51Z</dc:date>
    </item>
    <item>
      <title>Re: Extract last data from a month</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Extract-last-data-from-a-month/m-p/875605#M7340</link>
      <description>&lt;P&gt;Hi &lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="82403" data-lia-user-login="az38" class="lia-mention lia-mention-user"&gt;az38&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;&lt;P&gt;Thank you for your response, however, i didn't find the expected result.&lt;/P&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;Table = SUMMARIZE('total base','total base'[Fecha].[Month],"lastinv",LASTNONBLANK('total base'[Inventario],1))&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;The right one is the result of the table:&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;For example In January i just need 143947 as result.&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&lt;img /&gt;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;Thank you again.&lt;/DIV&gt;&lt;/DIV&gt;</description>
      <pubDate>Sun, 15 Dec 2019 18:04:30 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Extract-last-data-from-a-month/m-p/875605#M7340</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2019-12-15T18:04:30Z</dc:date>
    </item>
    <item>
      <title>Re: Extract last data from a month</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Extract-last-data-from-a-month/m-p/875606#M7341</link>
      <description>&lt;P&gt;Hi&amp;nbsp;Anonymous&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;for january result is correct as I see&lt;/P&gt;&lt;P&gt;the right table says that you have a data from other monthes.&lt;/P&gt;&lt;P&gt;if you want to see onle january try&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;Table = SUMMARIZE(FILTER('total base', MONTH('total_base'[[Fecha]])=1),'total base'[Fecha].[Month],"lastinv",LASTNONBLANK('total base'[Inventario],1))&lt;/LI-CODE&gt;&lt;P&gt;&lt;STRONG&gt;&lt;I&gt;&lt;FONT color="#ababab"&gt;do not hesitate to give a kudo to useful posts and mark solutions as solution&lt;/FONT&gt;&lt;/I&gt;&lt;/STRONG&gt;&lt;/P&gt;</description>
      <pubDate>Sun, 15 Dec 2019 18:31:34 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Extract-last-data-from-a-month/m-p/875606#M7341</guid>
      <dc:creator>az38</dc:creator>
      <dc:date>2019-12-15T18:31:34Z</dc:date>
    </item>
    <item>
      <title>Re: Extract last data from a month</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Extract-last-data-from-a-month/m-p/875611#M7342</link>
      <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="82403" data-lia-user-login="az38" class="lia-mention lia-mention-user"&gt;az38&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have a data base with weekly sales and inventory. I&amp;nbsp;can accumulate the sales during the year, but the inventory is the current state of stock in each week ( so the inventory of the month is the inventory of the last week of the month with data ).&lt;/P&gt;&lt;P&gt;I need a measure ( i suppose), that gives me the last week of inventory when i use each month in a visualization.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 15 Dec 2019 19:22:01 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Extract-last-data-from-a-month/m-p/875611#M7342</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2019-12-15T19:22:01Z</dc:date>
    </item>
    <item>
      <title>Re: Extract last data from a month</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Extract-last-data-from-a-month/m-p/875615#M7343</link>
      <description>&lt;P&gt;So,&amp;nbsp;Anonymous&lt;/a&gt;&amp;nbsp;the solution with summarized table doesnt satisfy you?&lt;/P&gt;&lt;P&gt;try a measure like&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;Measure = calculate(lastnonblank('total base'[Inventario],1). allexcept('total base','total base'[Fecha]))&lt;/LI-CODE&gt;&lt;P&gt;then in visual leave onle month-member of&amp;nbsp;'total base'[Fecha] hierarchy&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;I&gt;&lt;FONT color="#ababab"&gt;do not hesitate to give a kudo to useful posts and mark solutions as solution&lt;/FONT&gt;&lt;/I&gt;&lt;/STRONG&gt;&lt;/P&gt;</description>
      <pubDate>Sun, 15 Dec 2019 19:51:31 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Extract-last-data-from-a-month/m-p/875615#M7343</guid>
      <dc:creator>az38</dc:creator>
      <dc:date>2019-12-15T19:51:31Z</dc:date>
    </item>
    <item>
      <title>Re: Extract last data from a month</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Extract-last-data-from-a-month/m-p/875649#M7344</link>
      <description>&lt;P&gt;Still not working&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;</description>
      <pubDate>Sun, 15 Dec 2019 21:49:30 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Extract-last-data-from-a-month/m-p/875649#M7344</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2019-12-15T21:49:30Z</dc:date>
    </item>
    <item>
      <title>Re: Extract last data from a month</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Extract-last-data-from-a-month/m-p/876138#M7357</link>
      <description>&lt;P&gt;Anonymous&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;add .[Month]&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;Measure = 
calculate(lastnonblank('total base'[Inventario],1), allexcept('total base','total base'[Fecha].[Month]))&lt;/LI-CODE&gt;&lt;P&gt;looks like this&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;I&gt;&lt;FONT color="#ababab"&gt;do not hesitate to give a kudo to useful posts and mark solutions as solution&lt;/FONT&gt;&lt;/I&gt;&lt;/STRONG&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 16 Dec 2019 09:21:00 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Extract-last-data-from-a-month/m-p/876138#M7357</guid>
      <dc:creator>az38</dc:creator>
      <dc:date>2019-12-16T09:21:00Z</dc:date>
    </item>
    <item>
      <title>Re: Extract last data from a month</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Extract-last-data-from-a-month/m-p/876365#M7365</link>
      <description>&lt;P&gt;Hi,&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="82403" data-lia-user-login="az38" class="lia-mention lia-mention-user"&gt;az38&lt;/a&gt;&amp;nbsp; and thank you for your time and patience.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Your last solution should have worked, but it has not. I don't know if there is a problem with the&amp;nbsp;way that power bi sum the inventories in each week.&lt;/P&gt;&lt;DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;inv final mes = calculate(lastnonblank('total base'[Inventario],1), allexcept('total base','total base'[Fecha].[Month]))&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 16 Dec 2019 13:29:37 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Extract-last-data-from-a-month/m-p/876365#M7365</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2019-12-16T13:29:37Z</dc:date>
    </item>
    <item>
      <title>Re: Extract last data from a month</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Extract-last-data-from-a-month/m-p/876626#M7375</link>
      <description>&lt;P&gt;Hi&amp;nbsp;Anonymous&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;at last, i got it &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;&lt;P&gt;1. create a calculated column (not measure) in 'total base' table&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;r = 
RANKX( filter('total base';'total base'[Fecha].[Month]=earlier('total base'[Fecha].[Month]) &amp;amp;&amp;amp; not(isblank('total base'[Inventario])));'total base'[Fecha];;DESC)&lt;/LI-CODE&gt;&lt;P&gt;2. create a measure&amp;nbsp;in 'total base' table&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;inv final mes = 
calculate(lastnonblank('total base'[Inventario];sum('total base'[Inventario])); allexcept('total base';'total base'[Fecha].[Month]);'total base'[r]=1)&lt;/LI-CODE&gt;&lt;P&gt;next, leave only Month in Fecha hierarchy inside your visual&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;I&gt;&lt;FONT color="#ababab"&gt;do not hesitate to give a kudo to useful posts and mark solutions as solution&lt;/FONT&gt;&lt;/I&gt;&lt;/STRONG&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 16 Dec 2019 17:51:59 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Extract-last-data-from-a-month/m-p/876626#M7375</guid>
      <dc:creator>az38</dc:creator>
      <dc:date>2019-12-16T17:51:59Z</dc:date>
    </item>
  </channel>
</rss>

