<?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: Last no blank per category in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Last-no-blank-per-category/m-p/3276764#M121560</link>
    <description>&lt;P&gt;Anonymous&lt;/LI-USER&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;A calculated column cannot add new rows. Perhaps you mean a new calculated table?&lt;/P&gt;</description>
    <pubDate>Fri, 09 Jun 2023 14:17:55 GMT</pubDate>
    <dc:creator>tamerj1</dc:creator>
    <dc:date>2023-06-09T14:17:55Z</dc:date>
    <item>
      <title>Last no blank per category</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Last-no-blank-per-category/m-p/3276559#M121550</link>
      <description>&lt;P&gt;Hola, community.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have a fact table which brings values per category and inconsistently. Meaning some days are missing and those missing days differ per category. I want to fill those gaps with the dates for each category and give them last no blank value (corresponding to the category). I would prefer this doing in PQ. but DAX is also appreciated ( calculated column).&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I checked a nioce solution &lt;A href="https://community.fabric.microsoft.com/t5/Desktop/URGENT-Add-rows-with-missing-dates-in-Power-Query/m-p/2564649" target="_self"&gt;here&lt;/A&gt; but it does not seem to mind the category so was struggling to apply that.&amp;nbsp;&lt;/P&gt;&lt;P&gt;The current situation:&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;Desired solution:&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 09 Jun 2023 12:24:27 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Last-no-blank-per-category/m-p/3276559#M121550</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2023-06-09T12:24:27Z</dc:date>
    </item>
    <item>
      <title>Re: Last no blank per category</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Last-no-blank-per-category/m-p/3276723#M121555</link>
      <description>&lt;P&gt;Hi&amp;nbsp;Anonymous&lt;/LI-USER&gt;&amp;nbsp;&lt;BR /&gt;Please refer to attached sample file with the proposed solution&lt;/P&gt;
&lt;P&gt;&lt;img /&gt;&lt;img /&gt;&lt;/P&gt;
&lt;LI-CODE lang="javascript"&gt;Value Measure = 
VAR CurrentDate = MAX ( 'Date'[Date] )
VAR CurrentCategoryTable = CALCULATETABLE ( 'Table', ALLEXCEPT ( 'Table', 'Table'[Category] ) )
VAR TableBefore = FILTER ( CurrentCategoryTable, 'Table'[Date] &amp;lt; CurrentDate ) 
VAR PreviousRecord = TOPN ( 1, TableBefore, 'Table'[Date] )
VAR Result = SUMX ( PreviousRecord, 'Table'[Value] )
RETURN 
    IF ( 
        ISINSCOPE ( 'Table'[Category] ), 
        COALESCE ( SUM ( 'Table'[Value] ), Result )
    )&lt;/LI-CODE&gt;</description>
      <pubDate>Fri, 09 Jun 2023 13:50:07 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Last-no-blank-per-category/m-p/3276723#M121555</guid>
      <dc:creator>tamerj1</dc:creator>
      <dc:date>2023-06-09T13:50:07Z</dc:date>
    </item>
    <item>
      <title>Re: Last no blank per category</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Last-no-blank-per-category/m-p/3276746#M121559</link>
      <description>&lt;P&gt;Thank you for quick reply,&amp;nbsp;&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;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;But I would prefer a calculated column cause I need a row context. I mentioned it as well &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 09 Jun 2023 14:05:42 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Last-no-blank-per-category/m-p/3276746#M121559</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2023-06-09T14:05:42Z</dc:date>
    </item>
    <item>
      <title>Re: Last no blank per category</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Last-no-blank-per-category/m-p/3276764#M121560</link>
      <description>&lt;P&gt;Anonymous&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;A calculated column cannot add new rows. Perhaps you mean a new calculated table?&lt;/P&gt;</description>
      <pubDate>Fri, 09 Jun 2023 14:17:55 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Last-no-blank-per-category/m-p/3276764#M121560</guid>
      <dc:creator>tamerj1</dc:creator>
      <dc:date>2023-06-09T14:17:55Z</dc:date>
    </item>
    <item>
      <title>Re: Last no blank per category</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Last-no-blank-per-category/m-p/3276826#M121563</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;, indeed, CC will not expand table, apologies for confusion. So yes, either calculated table either power query.&lt;/P&gt;</description>
      <pubDate>Fri, 09 Jun 2023 14:48:08 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Last-no-blank-per-category/m-p/3276826#M121563</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2023-06-09T14:48:08Z</dc:date>
    </item>
    <item>
      <title>Re: Last no blank per category</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Last-no-blank-per-category/m-p/3276867#M121564</link>
      <description>&lt;P&gt;Anonymous&lt;/a&gt;&amp;nbsp;&lt;BR /&gt;Please refer to updated sample file with the calculated table proposed solution&lt;/P&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;LI-CODE lang="javascript"&gt;Table 2 = 
ADDCOLUMNS (
    CROSSJOIN (
        CALENDAR ( MIN ( 'Table'[Date] ), MAX ( 'Table'[Date] ) ),
        ALLNOBLANKROW (  'Table'[Category] )
    ),
    "Value", 
    MAXX ( 
        TOPN ( 
            1,
            FILTER ( 
                'Table', 
                'Table'[Category] = EARLIER ( 'Table'[Category] )
                    &amp;amp;&amp;amp; 'Table'[Date] &amp;lt;= EARLIER ( [Date] )
            ),
            'Table'[Date]
        ),
        'Table'[Value]
    )
)&lt;/LI-CODE&gt;</description>
      <pubDate>Fri, 09 Jun 2023 15:21:39 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Last-no-blank-per-category/m-p/3276867#M121564</guid>
      <dc:creator>tamerj1</dc:creator>
      <dc:date>2023-06-09T15:21:39Z</dc:date>
    </item>
  </channel>
</rss>

