<?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: Summarising in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Summarising/m-p/4022569#M158715</link>
    <description>&lt;P&gt;Thanks&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="555045" data-lia-user-login="some_bih" class="lia-mention lia-mention-user"&gt;some_bih&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Unfortunately, I can't remove them in PQ as I need the data for other parts of the report.&lt;/P&gt;</description>
    <pubDate>Wed, 03 Jul 2024 09:36:18 GMT</pubDate>
    <dc:creator>music43</dc:creator>
    <dc:date>2024-07-03T09:36:18Z</dc:date>
    <item>
      <title>Summarising</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Summarising/m-p/4022197#M158702</link>
      <description>&lt;P&gt;Hi&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;'Sales'&lt;/STRONG&gt; is my fact table with approx 5.5M rows and the granularity is at the order item level. An order can have anywhere from 1 to 9999 lines/rows.&lt;BR /&gt;The carriage/freight cost for each order is recorded on the item level and as such, if an order has more than one line/row, the value is repeated.&lt;BR /&gt;To allow me to SUM the unique carriage cost per transaction I want to group by the &lt;STRONG&gt;'Sales'[Transaction ID]&lt;/STRONG&gt;.&lt;BR /&gt;Additionally I have these filters&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;&amp;nbsp;&lt;STRONG&gt;'Sales'[Order Status] = "Invoiced"&lt;/STRONG&gt; - To remove cancelled or incomplete orders.&lt;/LI&gt;&lt;LI&gt;&amp;nbsp;&lt;STRONG&gt;'Sales'[Order Carriage (GBP)] &amp;lt;&amp;gt; 0&lt;/STRONG&gt; - To remove the 300K rows without a carriage charge.&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;This is what I have come up with so far and it works.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;Carriage =
VAR __InvoicedCarriage =
    FILTER(
        'Sales',
        'Sales'[Order Status]="Invoiced" 
        &amp;amp;&amp;amp; 'Sales'[Order Carriage (GBP)] &amp;lt;&amp;gt; 0
    )
VAR __GroupByOrderID =
    SUMMARIZE(
        __InvoicedCarriage,
        'Sales'[Transaction Id],
        'Sales'[Order Carriage (GBP)]
    )
VAR __Result =
    SUMX(
        __GroupByOrderID,
        'Sales'[Order Carriage (GBP)]
    )
RETURN
    __Result&lt;/LI-CODE&gt;&lt;P&gt;&lt;BR /&gt;My questions are as follows:&lt;/P&gt;&lt;P&gt;&lt;EM&gt;1) Is there a better (more compact/efficient) way to write my formula?&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;2) I thought it was bad practice to filter a fact table - How else could I do this?&lt;/EM&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 03 Jul 2024 07:41:11 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Summarising/m-p/4022197#M158702</guid>
      <dc:creator>music43</dc:creator>
      <dc:date>2024-07-03T07:41:11Z</dc:date>
    </item>
    <item>
      <title>Re: Summarising</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Summarising/m-p/4022553#M158714</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="26950" data-lia-user-login="music43" class="lia-mention lia-mention-user"&gt;music43&lt;/a&gt;&amp;nbsp;try in Power Query in pbi filter out your filter (or the best do not "import" at all) your 2 filters criteria&lt;/P&gt;
&lt;P&gt;Sales'[Order Status]="Invoiced"&lt;/P&gt;
&lt;P&gt;'Sales'[Order Carriage (GBP)] &amp;lt;&amp;gt;0&lt;/P&gt;</description>
      <pubDate>Wed, 03 Jul 2024 09:30:17 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Summarising/m-p/4022553#M158714</guid>
      <dc:creator>some_bih</dc:creator>
      <dc:date>2024-07-03T09:30:17Z</dc:date>
    </item>
    <item>
      <title>Re: Summarising</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Summarising/m-p/4022569#M158715</link>
      <description>&lt;P&gt;Thanks&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="555045" data-lia-user-login="some_bih" class="lia-mention lia-mention-user"&gt;some_bih&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Unfortunately, I can't remove them in PQ as I need the data for other parts of the report.&lt;/P&gt;</description>
      <pubDate>Wed, 03 Jul 2024 09:36:18 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Summarising/m-p/4022569#M158715</guid>
      <dc:creator>music43</dc:creator>
      <dc:date>2024-07-03T09:36:18Z</dc:date>
    </item>
    <item>
      <title>Re: Summarising</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Summarising/m-p/4022677#M158720</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="26950" data-lia-user-login="music43" class="lia-mention lia-mention-user"&gt;music43&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;ok for limitations of your model.&lt;/P&gt;
&lt;P&gt;The performance / optimisation is complex task including using&amp;nbsp; Performance analyzer, DAX Studio to see and check queries.&lt;/P&gt;
&lt;P&gt;One of option, to investigate best performance is eventually using GROUPBY, SUMMARIZE or pattern ADDCOLUMNS(SUMMARIZE&lt;/P&gt;
&lt;P&gt;Check &lt;A href="https://www.sqlbi.com/articles/differences-between-groupby-and-summarize/" target="_blank"&gt;link&lt;/A&gt; as example&lt;/P&gt;</description>
      <pubDate>Wed, 03 Jul 2024 10:34:25 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Summarising/m-p/4022677#M158720</guid>
      <dc:creator>some_bih</dc:creator>
      <dc:date>2024-07-03T10:34:25Z</dc:date>
    </item>
    <item>
      <title>Re: Summarising</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Summarising/m-p/4023933#M158821</link>
      <description>&lt;P&gt;Hi,&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="26950" data-lia-user-login="music43" class="lia-mention lia-mention-user"&gt;music43&lt;/a&gt;&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;Thanks for&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="555045" data-lia-user-login="some_bih" class="lia-mention lia-mention-user"&gt;some_bih&lt;/a&gt;&amp;nbsp;reply. You can try the following measure(compact).&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;Carriage =
SUMX(
    SUMMARIZE(
        FILTER(
            'Sales',
            'Sales'[Order Status] = "Invoiced"
            &amp;amp;&amp;amp; 'Sales'[Order Carriage (GBP)] &amp;lt;&amp;gt; 0
        ),
        'Sales'[Transaction Id],
        'Sales'[Order Carriage (GBP)]
    ),
    'Sales'[Order Carriage (GBP)]
)
&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P style="text-align: justify; text-justify: inter-ideograph;"&gt;&lt;SPAN&gt;Best Regards,&lt;BR /&gt;Yang&lt;/SPAN&gt;&lt;SPAN&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN&gt;Community Support Team&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="background: white;"&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="background: white;"&gt;&lt;SPAN&gt;If there is any post &lt;/SPAN&gt;&lt;STRONG&gt;&lt;I&gt;&lt;SPAN&gt;helps&lt;/SPAN&gt;&lt;/I&gt;&lt;/STRONG&gt;&lt;SPAN&gt;, then please consider &lt;/SPAN&gt;&lt;STRONG&gt;&lt;I&gt;&lt;SPAN&gt;Accept it as the solution&lt;/SPAN&gt;&lt;/I&gt;&lt;/STRONG&gt;&lt;SPAN&gt;&amp;nbsp;to&lt;/SPAN&gt;&lt;SPAN&gt;&amp;nbsp;help the other members find it more quickly.&lt;BR /&gt;If I misunderstand your needs or you still have problems on it, please feel free to let us know. &lt;/SPAN&gt;&lt;STRONG&gt;&lt;I&gt;&lt;SPAN&gt;Thanks a lot!&lt;/SPAN&gt;&lt;/I&gt;&lt;/STRONG&gt;&lt;/P&gt;
&lt;P style="background: white;"&gt;&lt;U&gt;&lt;SPAN&gt;&lt;A href="https://nam06.safelinks.protection.outlook.com/?url=https%3A%2F%2Fcommunity.powerbi.com%2Ft5%2FCommunity-Blog%2FHow-to-Get-Your-Question-Answered-Quickly%2Fba-p%2F38490&amp;amp;data=05%7C01%7Cv-yaningyang%40microsoft.com%7C326a6d727194478c197008dbefc04904%7C72f988bf86f141af91ab2d7cd011db47%7C1%7C0%7C638367381365912356%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&amp;amp;sdata=7IzyI2%2FMOAR%2FYCjWYSKCZL2VPmT4PsxuWBjdUdMWKzo%3D&amp;amp;reserved=0" data-auth="NotApplicable" target="_blank"&gt;How to get your questions answered quickly&lt;/A&gt;&lt;/SPAN&gt;&lt;/U&gt;&lt;SPAN&gt;&amp;nbsp;-- &lt;/SPAN&gt;&lt;U&gt;&lt;SPAN&gt;&lt;A href="https://nam06.safelinks.protection.outlook.com/?url=https%3A%2F%2Fcommunity.powerbi.com%2Ft5%2FCommunity-Blog%2FHow-to-provide-sample-data-in-the-Power-BI-Forum%2Fba-p%2F963216&amp;amp;data=05%7C01%7Cv-yaningyang%40microsoft.com%7C326a6d727194478c197008dbefc04904%7C72f988bf86f141af91ab2d7cd011db47%7C1%7C0%7C638367381365919045%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&amp;amp;sdata=VeafzdwAsrpisD8s261%2FdyOwJ1aCtBXS3bPA6NODOHY%3D&amp;amp;reserved=0" data-auth="NotApplicable" target="_blank"&gt;&amp;nbsp;How to provide sample data in the Power BI Forum&lt;/A&gt;&lt;/SPAN&gt;&lt;/U&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 04 Jul 2024 02:04:39 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Summarising/m-p/4023933#M158821</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2024-07-04T02:04:39Z</dc:date>
    </item>
  </channel>
</rss>

