<?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 Better Sales from New Customers in Quick Measures Gallery</title>
    <link>https://community.fabric.microsoft.com/t5/Quick-Measures-Gallery/Better-Sales-from-New-Customers/m-p/2843073#M904</link>
    <description>&lt;P&gt;Continuing with exploring alternatives to Power BI's default quick measures that don't involve the CALCULATE function, such as&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;A href="https://community.powerbi.com/t5/Quick-Measures-Gallery/Better-Running-Total/td-p/2755666" target="_self"&gt;Better Running Total&lt;/A&gt;&lt;SPAN&gt;,&amp;nbsp;&lt;/SPAN&gt;&lt;A href="https://community.powerbi.com/t5/Quick-Measures-Gallery/Better-Average-per-Category/td-p/2758871" target="_self"&gt;Better Average per Category&lt;/A&gt;, &lt;A href="https://community.powerbi.com/t5/Quick-Measures-Gallery/Better-Weighted-Average-per-Category/td-p/2805460" target="_self"&gt;Better Weighted Average per Category&lt;/A&gt;, and &lt;A href="https://community.powerbi.com/t5/Quick-Measures-Gallery/Better-Filtered-Value/td-p/2828654" target="_self"&gt;Better Filtered Value&lt;/A&gt; this one is for Better Sales from New Customers.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Power BI's Sales from New Customers quick measure returns something like this:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;Value for new ID = 
VAR __CURRENT_VALUES = SUMMARIZE(VALUES('Table'), 'Table'[ID])
VAR __EXISTING_VALUES =
	CALCULATETABLE(
		SUMMARIZE(VALUES('Table'), 'Table'[ID]),
		FILTER(ALL('Dates'[Date]), 'Dates'[Date] &amp;lt; MIN('Dates'[Date])),
		KEEPFILTERS(__CURRENT_VALUES)
	)
RETURN
	CALCULATE(SUM('Table'[Value]), EXCEPT(__CURRENT_VALUES, __EXISTING_VALUES))&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;This has some extremely weird and concerning syntax like the use of VALUES for one and the ridiculous way in which SUMMARIZE and VALUES are used together. Also, this measure only works at the Date level and does not roll-up to things like Month, Quarter and Year. There's a better way like:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;Better Sales from New Customers = 
    VAR __CurrentCustomers = DISTINCT('Table'[ID])
    VAR __MinDate = MIN('Table'[Date])
    VAR __Table = FILTER(ALL('Table'),[Date] &amp;lt; __MinDate)
    VAR __PreviousCustomers = 
        DISTINCT(
            SELECTCOLUMNS(
                __Table,
                "ID",[ID]
            )
        )
    VAR __NewCustomers = EXCEPT(__CurrentCustomers, __PreviousCustomers)
RETURN
    SUMX(FILTER('Table',[ID] IN __NewCustomers),[Value])&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Watch the video!&lt;/P&gt;
&lt;P&gt;&lt;div data-video-id="https://youtu.be/X5AG3-M1avU" data-video-remote-vid="https://youtu.be/X5AG3-M1avU" class="lia-video-container lia-media-is-center lia-media-size-medium"&gt;&lt;iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fwww.youtube.com%2Fembed%2FX5AG3-M1avU%3Ffeature%3Doembed&amp;amp;display_name=YouTube&amp;amp;url=https%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3DX5AG3-M1avU&amp;amp;image=https%3A%2F%2Fi.ytimg.com%2Fvi%2FX5AG3-M1avU%2Fhqdefault.jpg&amp;amp;type=text%2Fhtml&amp;amp;schema=youtube" allowfullscreen="" style="max-width: 100%"&gt;&lt;/iframe&gt;&lt;/div&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN class="reportid hidden"&gt;eyJrIjoiNzY3OWZjOGMtYTdiMy00ZTFkLWJjNjgtNzhlZjEwNDliYzQ0IiwidCI6IjRhMDQyNzQzLTM3M2EtNDNkMi04MjdiLTAwM2Y0YzdiYTFlNSIsImMiOjN9&lt;/SPAN&gt;&lt;/P&gt;</description>
    <pubDate>Fri, 14 Oct 2022 16:57:51 GMT</pubDate>
    <dc:creator>Greg_Deckler</dc:creator>
    <dc:date>2022-10-14T16:57:51Z</dc:date>
    <item>
      <title>Better Sales from New Customers</title>
      <link>https://community.fabric.microsoft.com/t5/Quick-Measures-Gallery/Better-Sales-from-New-Customers/m-p/2843073#M904</link>
      <description>&lt;P&gt;Continuing with exploring alternatives to Power BI's default quick measures that don't involve the CALCULATE function, such as&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;A href="https://community.powerbi.com/t5/Quick-Measures-Gallery/Better-Running-Total/td-p/2755666" target="_self"&gt;Better Running Total&lt;/A&gt;&lt;SPAN&gt;,&amp;nbsp;&lt;/SPAN&gt;&lt;A href="https://community.powerbi.com/t5/Quick-Measures-Gallery/Better-Average-per-Category/td-p/2758871" target="_self"&gt;Better Average per Category&lt;/A&gt;, &lt;A href="https://community.powerbi.com/t5/Quick-Measures-Gallery/Better-Weighted-Average-per-Category/td-p/2805460" target="_self"&gt;Better Weighted Average per Category&lt;/A&gt;, and &lt;A href="https://community.powerbi.com/t5/Quick-Measures-Gallery/Better-Filtered-Value/td-p/2828654" target="_self"&gt;Better Filtered Value&lt;/A&gt; this one is for Better Sales from New Customers.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Power BI's Sales from New Customers quick measure returns something like this:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;Value for new ID = 
VAR __CURRENT_VALUES = SUMMARIZE(VALUES('Table'), 'Table'[ID])
VAR __EXISTING_VALUES =
	CALCULATETABLE(
		SUMMARIZE(VALUES('Table'), 'Table'[ID]),
		FILTER(ALL('Dates'[Date]), 'Dates'[Date] &amp;lt; MIN('Dates'[Date])),
		KEEPFILTERS(__CURRENT_VALUES)
	)
RETURN
	CALCULATE(SUM('Table'[Value]), EXCEPT(__CURRENT_VALUES, __EXISTING_VALUES))&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;This has some extremely weird and concerning syntax like the use of VALUES for one and the ridiculous way in which SUMMARIZE and VALUES are used together. Also, this measure only works at the Date level and does not roll-up to things like Month, Quarter and Year. There's a better way like:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;Better Sales from New Customers = 
    VAR __CurrentCustomers = DISTINCT('Table'[ID])
    VAR __MinDate = MIN('Table'[Date])
    VAR __Table = FILTER(ALL('Table'),[Date] &amp;lt; __MinDate)
    VAR __PreviousCustomers = 
        DISTINCT(
            SELECTCOLUMNS(
                __Table,
                "ID",[ID]
            )
        )
    VAR __NewCustomers = EXCEPT(__CurrentCustomers, __PreviousCustomers)
RETURN
    SUMX(FILTER('Table',[ID] IN __NewCustomers),[Value])&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Watch the video!&lt;/P&gt;
&lt;P&gt;&lt;div data-video-id="https://youtu.be/X5AG3-M1avU" data-video-remote-vid="https://youtu.be/X5AG3-M1avU" class="lia-video-container lia-media-is-center lia-media-size-medium"&gt;&lt;iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fwww.youtube.com%2Fembed%2FX5AG3-M1avU%3Ffeature%3Doembed&amp;amp;display_name=YouTube&amp;amp;url=https%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3DX5AG3-M1avU&amp;amp;image=https%3A%2F%2Fi.ytimg.com%2Fvi%2FX5AG3-M1avU%2Fhqdefault.jpg&amp;amp;type=text%2Fhtml&amp;amp;schema=youtube" allowfullscreen="" style="max-width: 100%"&gt;&lt;/iframe&gt;&lt;/div&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN class="reportid hidden"&gt;eyJrIjoiNzY3OWZjOGMtYTdiMy00ZTFkLWJjNjgtNzhlZjEwNDliYzQ0IiwidCI6IjRhMDQyNzQzLTM3M2EtNDNkMi04MjdiLTAwM2Y0YzdiYTFlNSIsImMiOjN9&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 14 Oct 2022 16:57:51 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Quick-Measures-Gallery/Better-Sales-from-New-Customers/m-p/2843073#M904</guid>
      <dc:creator>Greg_Deckler</dc:creator>
      <dc:date>2022-10-14T16:57:51Z</dc:date>
    </item>
  </channel>
</rss>

