<?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: How to rewrite summarize with addcolumns for my scenario in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-rewrite-summarize-with-addcolumns-for-my-scenario/m-p/3210300#M117069</link>
    <description>&lt;LI-CODE lang="markup"&gt;VAR CHECKPOINTNEXT =
CALCULATETABLE(
    VALUES( 'Measure Benefit Progress List'[CheckPoint] ),
    VALUE( 'Measure Benefit Progress List'[Financial Year Search] )
        = VALUE( FINANCIALYEARNEXT ) &amp;amp;&amp;amp; 
    'Measure Benefit Progress List'[Main ID LkUpId] = MBM_Id
)&lt;/LI-CODE&gt;
&lt;P&gt;Keeping as one filter by using '&amp;amp;&amp;amp;' gives better timing results.&lt;/P&gt;</description>
    <pubDate>Fri, 28 Apr 2023 01:46:16 GMT</pubDate>
    <dc:creator>garythomannCoGC</dc:creator>
    <dc:date>2023-04-28T01:46:16Z</dc:date>
    <item>
      <title>How to rewrite summarize with addcolumns for my scenario</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-rewrite-summarize-with-addcolumns-for-my-scenario/m-p/3208453#M116943</link>
      <description>&lt;P&gt;Using summarize is not best practice.&amp;nbsp; &amp;nbsp;&lt;A title="Best practices using SUMMARIZE and ADDCOLUMNS" href="https://www.sqlbi.com/articles/best-practices-using-summarize-and-addcolumns/" target="_self"&gt;Best practices using SUMMARIZE and ADDCOLUMNS&lt;/A&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The code below works both in daxstudio and in my dataset.&amp;nbsp; The child table MBPL gets a new column added call CheckPoint Next.&lt;/P&gt;
&lt;P&gt;Great.&amp;nbsp; But reading the above article using summarize is not good.&amp;nbsp; So how to refactor the below?&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;--CheckPoint Next =   -- uncomment for pbi desktop 
EVALUATE   -- comment out for pbi desktop but needed for daxstudio
    VAR FINANCIALYEARNEXT = SELECTEDVALUE ( 'x Reference Dates'[FINANCIALYEARNEXT] )
    VAR MBM_Id = "148"   -- testing 
    --VAR MBM_Id = 'Measure Benefit Master'[Id]   -- uncomment for pbi desktop 
    VAR CHECKPOINTNEXT = 
        SUMMARIZE ( 
            FILTER ( 
                VALUES ( 'Measure Benefit Progress List' ),  
                VALUE ( 'Measure Benefit Progress List'[Financial Year Search] ) = VALUE ( FINANCIALYEARNEXT ) &amp;amp;&amp;amp; 
                'Measure Benefit Progress List'[Main ID LkUpId] = MBM_Id
            ),
            [CheckPoint]
        ) )
RETURN 
    { CHECKPOINTNEXT }
&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 27 Apr 2023 05:09:28 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-rewrite-summarize-with-addcolumns-for-my-scenario/m-p/3208453#M116943</guid>
      <dc:creator>garythomannCoGC</dc:creator>
      <dc:date>2023-04-27T05:09:28Z</dc:date>
    </item>
    <item>
      <title>Re: How to rewrite summarize with addcolumns for my scenario</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-rewrite-summarize-with-addcolumns-for-my-scenario/m-p/3208947#M116970</link>
      <description>&lt;P&gt;(just a syntax error in your snipette of code, a ")" is redundant before RETURN)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;EVALUATE
-- comment out for pbi desktop but needed for daxstudio
VAR FINANCIALYEARNEXT =
    SELECTEDVALUE( 'x Reference Dates'[FINANCIALYEARNEXT] )
VAR MBM_Id = "148" -- testing 
--VAR MBM_Id = 'Measure Benefit Master'[Id]   -- uncomment for pbi desktop 
VAR CHECKPOINTNEXT =
    SUMMARIZE(
        FILTER(
            VALUES( 'Measure Benefit Progress List' ),
            VALUE( 'Measure Benefit Progress List'[Financial Year Search] )
                = VALUE( FINANCIALYEARNEXT )
                &amp;amp;&amp;amp; 'Measure Benefit Progress List'[Main ID LkUpId] = MBM_Id
        ),
        [CheckPoint]
    )
RETURN
    { CHECKPOINTNEXT }&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Nothing to change in your case since you did nothing but just extract distinct values of &lt;SPAN&gt;'Measure&amp;nbsp;Benefit&amp;nbsp;Progress&amp;nbsp;List'&lt;/SPAN&gt;[&lt;SPAN&gt;CheckPoint&lt;/SPAN&gt;].&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;From syntactic perspective, it equals to&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;VAR CHECKPOINTNEXT =
CALCULATETABLE(
    VALUES( 'Measure Benefit Progress List'[CheckPoint] ),
    VALUE( 'Measure Benefit Progress List'[Financial Year Search] )
        = VALUE( FINANCIALYEARNEXT ),
    'Measure Benefit Progress List'[Main ID LkUpId] = MBM_Id
)&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 27 Apr 2023 09:42:43 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-rewrite-summarize-with-addcolumns-for-my-scenario/m-p/3208947#M116970</guid>
      <dc:creator>ThxAlot</dc:creator>
      <dc:date>2023-04-27T09:42:43Z</dc:date>
    </item>
    <item>
      <title>Re: How to rewrite summarize with addcolumns for my scenario</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-rewrite-summarize-with-addcolumns-for-my-scenario/m-p/3210300#M117069</link>
      <description>&lt;LI-CODE lang="markup"&gt;VAR CHECKPOINTNEXT =
CALCULATETABLE(
    VALUES( 'Measure Benefit Progress List'[CheckPoint] ),
    VALUE( 'Measure Benefit Progress List'[Financial Year Search] )
        = VALUE( FINANCIALYEARNEXT ) &amp;amp;&amp;amp; 
    'Measure Benefit Progress List'[Main ID LkUpId] = MBM_Id
)&lt;/LI-CODE&gt;
&lt;P&gt;Keeping as one filter by using '&amp;amp;&amp;amp;' gives better timing results.&lt;/P&gt;</description>
      <pubDate>Fri, 28 Apr 2023 01:46:16 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-rewrite-summarize-with-addcolumns-for-my-scenario/m-p/3210300#M117069</guid>
      <dc:creator>garythomannCoGC</dc:creator>
      <dc:date>2023-04-28T01:46:16Z</dc:date>
    </item>
  </channel>
</rss>

