<?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: New Table - Calendar and Summarize in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/New-Table-Calendar-and-Summarize/m-p/4000115#M155778</link>
    <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="383085" data-lia-user-login="paul_luvaglia" class="lia-mention lia-mention-user"&gt;paul_luvaglia&lt;/a&gt;&amp;nbsp;Try something like:&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;Table = 
  VAR __Years = DISTINCT('Table'[Year])
  VAR __Months = DISTINCT('Table'[Month])
  VAR __Parts = DISTINCT('Table'[Part])
  VAR __Table =
    ADDCOLUMNS(
      CROSSJOIN(
        CROSSJOIN( __Parts, __Years ),
        __Months
      ),
      "__Count",
        VAR __Part = [Part]
        VAR __Result = COUNTROWS( FILTER( 'Table', [Part] = __Part ) ) + 0
      RETURN
        __Result
    )
RETURN
  __Table&lt;/LI-CODE&gt;
&lt;P&gt;Otherwise,&amp;nbsp;Sorry, having trouble following, can you post sample data as text and expected output?&lt;BR /&gt;Not really enough information to go on, please first check if your issue is a common issue listed here: &lt;A href="https://community.powerbi.com/t5/Community-Blog/Before-You-Post-Read-This/ba-p/1116882" target="_blank"&gt;https://community.powerbi.com/t5/Community-Blog/Before-You-Post-Read-This/ba-p/1116882&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;Also, please see this post regarding How to Get Your Question Answered Quickly: &lt;A href="https://community.powerbi.com/t5/Community-Blog/How-to-Get-Your-Question-Answered-Quickly/ba-p/38490" target="_blank"&gt;https://community.powerbi.com/t5/Community-Blog/How-to-Get-Your-Question-Answered-Quickly/ba-p/38490&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;The most important parts are:&lt;BR /&gt;1. Sample data as text, use the table tool in the editing bar&lt;BR /&gt;2. Expected output from sample data&lt;BR /&gt;3. Explanation in words of how to get from 1. to 2.&lt;/P&gt;</description>
    <pubDate>Wed, 19 Jun 2024 12:19:18 GMT</pubDate>
    <dc:creator>Greg_Deckler</dc:creator>
    <dc:date>2024-06-19T12:19:18Z</dc:date>
    <item>
      <title>New Table - Calendar and Summarize</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/New-Table-Calendar-and-Summarize/m-p/4000104#M155777</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have a table of sales data by invoice number and part number.&amp;nbsp;&lt;/P&gt;&lt;P&gt;Each part may not be sold every month&lt;/P&gt;&lt;P&gt;I would like a summary table by part, year and month - but to include all year/month/part combinations even if we no invoices are in the source table for the year/month/part combination&lt;/P&gt;&lt;P&gt;How do I do this?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Many Thanks&lt;/P&gt;</description>
      <pubDate>Wed, 19 Jun 2024 12:09:46 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/New-Table-Calendar-and-Summarize/m-p/4000104#M155777</guid>
      <dc:creator>paul_luvaglia</dc:creator>
      <dc:date>2024-06-19T12:09:46Z</dc:date>
    </item>
    <item>
      <title>Re: New Table - Calendar and Summarize</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/New-Table-Calendar-and-Summarize/m-p/4000115#M155778</link>
      <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="383085" data-lia-user-login="paul_luvaglia" class="lia-mention lia-mention-user"&gt;paul_luvaglia&lt;/a&gt;&amp;nbsp;Try something like:&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;Table = 
  VAR __Years = DISTINCT('Table'[Year])
  VAR __Months = DISTINCT('Table'[Month])
  VAR __Parts = DISTINCT('Table'[Part])
  VAR __Table =
    ADDCOLUMNS(
      CROSSJOIN(
        CROSSJOIN( __Parts, __Years ),
        __Months
      ),
      "__Count",
        VAR __Part = [Part]
        VAR __Result = COUNTROWS( FILTER( 'Table', [Part] = __Part ) ) + 0
      RETURN
        __Result
    )
RETURN
  __Table&lt;/LI-CODE&gt;
&lt;P&gt;Otherwise,&amp;nbsp;Sorry, having trouble following, can you post sample data as text and expected output?&lt;BR /&gt;Not really enough information to go on, please first check if your issue is a common issue listed here: &lt;A href="https://community.powerbi.com/t5/Community-Blog/Before-You-Post-Read-This/ba-p/1116882" target="_blank"&gt;https://community.powerbi.com/t5/Community-Blog/Before-You-Post-Read-This/ba-p/1116882&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;Also, please see this post regarding How to Get Your Question Answered Quickly: &lt;A href="https://community.powerbi.com/t5/Community-Blog/How-to-Get-Your-Question-Answered-Quickly/ba-p/38490" target="_blank"&gt;https://community.powerbi.com/t5/Community-Blog/How-to-Get-Your-Question-Answered-Quickly/ba-p/38490&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;The most important parts are:&lt;BR /&gt;1. Sample data as text, use the table tool in the editing bar&lt;BR /&gt;2. Expected output from sample data&lt;BR /&gt;3. Explanation in words of how to get from 1. to 2.&lt;/P&gt;</description>
      <pubDate>Wed, 19 Jun 2024 12:19:18 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/New-Table-Calendar-and-Summarize/m-p/4000115#M155778</guid>
      <dc:creator>Greg_Deckler</dc:creator>
      <dc:date>2024-06-19T12:19:18Z</dc:date>
    </item>
    <item>
      <title>Re: New Table - Calendar and Summarize</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/New-Table-Calendar-and-Summarize/m-p/4000135#M155779</link>
      <description>&lt;P&gt;This would be a quick example of the source&lt;/P&gt;&lt;TAB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endar-and-Summarize/m-p/4000135#M155779</guid>
      <dc:creator>paul_luvaglia</dc:creator>
      <dc:date>2024-06-19T12:30:48Z</dc:date>
    </item>
    <item>
      <title>Re: New Table - Calendar and Summarize</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/New-Table-Calendar-and-Summarize/m-p/4000980#M155906</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="383085" data-lia-user-login="paul_luvaglia" class="lia-mention lia-mention-user"&gt;paul_luvaglia&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I think&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;‘s solution is great!! just change the countrows to the aggregation you need depending on your needs. If it's just following the sample data you gave, you could probably just create a simple calculated column:&lt;/P&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;Column = IF([Qty]=BLANK(),[Qty]+0,[Qty])&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;An attachment for your reference. Hope it helps!&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Best regards,&lt;BR /&gt;Community Support Team_ Scott Chang&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If this post helps then please consider&amp;nbsp;&lt;STRONG&gt;Accept it as the solution&lt;/STRONG&gt;&amp;nbsp;to help the other members find it more quickly.&lt;/P&gt;
&lt;P&gt;&lt;LI-WRAPPER&gt;&lt;/LI-WRAPPER&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 20 Jun 2024 02:24:55 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/New-Table-Calendar-and-Summarize/m-p/4000980#M155906</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2024-06-20T02:24:55Z</dc:date>
    </item>
    <item>
      <title>Re: New Table - Calendar and Summarize</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/New-Table-Calendar-and-Summarize/m-p/4002598#M156067</link>
      <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="383085" data-lia-user-login="paul_luvaglia" class="lia-mention lia-mention-user"&gt;paul_luvaglia&lt;/a&gt;&amp;nbsp;Sorry, got pulled away yesterday. If all you have is a single table, then you could do this tweak to the original formula. PBIX is attached below signature.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;Table 2 = 
  VAR __Years = DISTINCT('Table'[Year])
  VAR __Months = GENERATESERIES( MIN('Table'[Month]), MAX('Table'[Month]), 1 )
  VAR __Parts = DISTINCT('Table'[Part])
  VAR __Table =
    ADDCOLUMNS(
      CROSSJOIN(
        CROSSJOIN( __Parts, __Years ),
        __Months
      ),
      "__Count",
        VAR __Part = [Part]
        VAR __Year = [Year]
        VAR __Month = [Value]
        VAR __Result = SUMX( FILTER( 'Table', [Part] = __Part &amp;amp;&amp;amp; [Year] = __Year &amp;amp;&amp;amp; [Month] = __Month ), [Qty]) + 0
      RETURN
        __Result
    )
    VAR __Result = SELECTCOLUMNS( __Table, "Part", [Part], "Year", [Year], "Month", [Value], "Count", [__Count] )
RETURN
  __Result&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 20 Jun 2024 17:43:01 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/New-Table-Calendar-and-Summarize/m-p/4002598#M156067</guid>
      <dc:creator>Greg_Deckler</dc:creator>
      <dc:date>2024-06-20T17:43:01Z</dc:date>
    </item>
  </channel>
</rss>

