<?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: DAX to Add missing date (end of month) and assign last non zero / blank value in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DAX-to-Add-missing-date-end-of-month-and-assign-last-non-zero/m-p/2550603#M72161</link>
    <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="317289" data-lia-user-login="tamerj1" class="lia-mention lia-mention-user"&gt;tamerj1&lt;/a&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Tue, 31 May 2022 14:31:23 GMT</pubDate>
    <dc:creator>p_rathinavel</dc:creator>
    <dc:date>2022-05-31T14:31:23Z</dc:date>
    <item>
      <title>DAX to Add missing date (end of month) and assign last non zero / blank value</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DAX-to-Add-missing-date-end-of-month-and-assign-last-non-zero/m-p/2550595#M72160</link>
      <description>&lt;P&gt;Hi All,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I’m seeking help with some tricks with DAX, I’m trying to calculate the price of an item bought each month. But the item is not bought during few months in a year. For the missing months I want to add the rows with the last date of the month and take the price of the last non blank value.&lt;/P&gt;&lt;P&gt;Please refer the example below&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks for the help in advance&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;NOTE as i have million of different items for the many year it is difficult to figure out an idea please help&lt;/P&gt;</description>
      <pubDate>Tue, 31 May 2022 14:29:43 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DAX-to-Add-missing-date-end-of-month-and-assign-last-non-zero/m-p/2550595#M72160</guid>
      <dc:creator>p_rathinavel</dc:creator>
      <dc:date>2022-05-31T14:29:43Z</dc:date>
    </item>
    <item>
      <title>Re: DAX to Add missing date (end of month) and assign last non zero / blank value</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DAX-to-Add-missing-date-end-of-month-and-assign-last-non-zero/m-p/2550603#M72161</link>
      <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="317289" data-lia-user-login="tamerj1" class="lia-mention lia-mention-user"&gt;tamerj1&lt;/a&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 31 May 2022 14:31:23 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DAX-to-Add-missing-date-end-of-month-and-assign-last-non-zero/m-p/2550603#M72161</guid>
      <dc:creator>p_rathinavel</dc:creator>
      <dc:date>2022-05-31T14:31:23Z</dc:date>
    </item>
    <item>
      <title>Re: DAX to Add missing date (end of month) and assign last non zero / blank value</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DAX-to-Add-missing-date-end-of-month-and-assign-last-non-zero/m-p/2556871#M72620</link>
      <description>&lt;P&gt;Hi,&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="299927" data-lia-user-login="p_rathinavel" class="lia-mention lia-mention-user"&gt;p_rathinavel&lt;/a&gt;&amp;nbsp;;&lt;/P&gt;
&lt;P&gt;You need add another date table expand all date in every month.&lt;/P&gt;
&lt;LI-CODE lang="java"&gt;Date = SUMMARIZE( ADDCOLUMNS( CALENDAR(MIN('Table1'[Date]),MAX('Table1'[Date])),"Date end",EOMONTH([Date],0),"Item",MAX('Table1'[Item])),[Date end],[Item])&lt;/LI-CODE&gt;
&lt;P&gt;Then create a measure.&lt;/P&gt;
&lt;LI-CODE lang="java"&gt;Measure = 
var _date=CALCULATE(MIN('Table1'[End of Month]),FILTER('Table1',[End of Month]&amp;gt;=MAX('Date'[Date end])))
return IF(MAX('Date'[Date end]) in VALUES('Table1'[End of Month]),
CALCULATE(SUM('Table1'[Price]),FILTER('Table1',[End of Month]=MAX('Date'[Date end]))),
CALCULATE(SUM('Table1'[Price]),FILTER('Table1',[End of Month]=_date)))&lt;/LI-CODE&gt;
&lt;P&gt;The final show:&lt;/P&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;Best Regards,&lt;BR /&gt;Community Support Team _ Yalan Wu&lt;BR /&gt;If this post &lt;STRONG&gt;&lt;I&gt;helps&lt;/I&gt;&lt;/STRONG&gt;, then please consider &lt;STRONG&gt;&lt;I&gt;Accept it as the solution&lt;/I&gt;&lt;/STRONG&gt; to help the other members find it more quickly.&lt;/P&gt;</description>
      <pubDate>Fri, 03 Jun 2022 06:18:34 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DAX-to-Add-missing-date-end-of-month-and-assign-last-non-zero/m-p/2556871#M72620</guid>
      <dc:creator>v-yalanwu-msft</dc:creator>
      <dc:date>2022-06-03T06:18:34Z</dc:date>
    </item>
  </channel>
</rss>

