<?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 Filtering for &amp;quot;NEW&amp;quot; customers in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Filtering-for-quot-NEW-quot-customers/m-p/1777637#M37276</link>
    <description>&lt;P&gt;Hi All,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I want to have a table with customers and their revenue broken out by quarters. I only want to show them if their first time doing business with us is within the most recent 4 quarters (Thats what we considered "NEW"). I have a date filter, so I want this to interact with the date filter. So if I set the filter to the previous quarter, I could see who was categorized as "NEW" last quarter.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Here is a measure I created, but it is not working properly:&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;NEW CUSTOMER =&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&lt;SPAN&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;VAR LastSaleDateSlicer = CALCULATETABLE ( LASTNONBLANK ( DimDate[DateKey], 0 ), ALLSELECTED(FactSales))&lt;/SPAN&gt;&lt;/DIV&gt;&lt;BR /&gt;&lt;DIV&gt;&lt;SPAN&gt;VAR TwelveMonthsPrior = EDATE(LastSaleDateSlicer,-12)&lt;/SPAN&gt;&lt;/DIV&gt;&lt;BR /&gt;&lt;DIV&gt;&lt;SPAN&gt;RETURN&lt;/SPAN&gt;&lt;/DIV&gt;&lt;BR /&gt;&lt;DIV&gt;&lt;SPAN&gt;SWITCH(TRUE(),&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;SUMX(&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;FILTER(FactSales,FORMAT(TwelveMonthsPrior,"YYYYMM")&amp;gt;FORMAT(FactSales[RevenueRecognitionDate],"YYYYMM")),&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;FactSales[Revenue]) &lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;lt;= 0 &lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;amp;&amp;amp; &lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;SUMX(&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;FILTER(FactSales,FORMAT(TwelveMonthsPrior,"YYYYMM")&amp;lt;=FORMAT(FactSales[RevenueRecognitionDate],"YYYYMM")),&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;FactSales[Revenue]) &lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;gt; 0, "NEW",&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;"OLD")&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;Thank you for your help!&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;</description>
    <pubDate>Fri, 09 Apr 2021 19:08:21 GMT</pubDate>
    <dc:creator>cbolling</dc:creator>
    <dc:date>2021-04-09T19:08:21Z</dc:date>
    <item>
      <title>Filtering for "NEW" customers</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Filtering-for-quot-NEW-quot-customers/m-p/1777637#M37276</link>
      <description>&lt;P&gt;Hi All,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I want to have a table with customers and their revenue broken out by quarters. I only want to show them if their first time doing business with us is within the most recent 4 quarters (Thats what we considered "NEW"). I have a date filter, so I want this to interact with the date filter. So if I set the filter to the previous quarter, I could see who was categorized as "NEW" last quarter.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Here is a measure I created, but it is not working properly:&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;NEW CUSTOMER =&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&lt;SPAN&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;VAR LastSaleDateSlicer = CALCULATETABLE ( LASTNONBLANK ( DimDate[DateKey], 0 ), ALLSELECTED(FactSales))&lt;/SPAN&gt;&lt;/DIV&gt;&lt;BR /&gt;&lt;DIV&gt;&lt;SPAN&gt;VAR TwelveMonthsPrior = EDATE(LastSaleDateSlicer,-12)&lt;/SPAN&gt;&lt;/DIV&gt;&lt;BR /&gt;&lt;DIV&gt;&lt;SPAN&gt;RETURN&lt;/SPAN&gt;&lt;/DIV&gt;&lt;BR /&gt;&lt;DIV&gt;&lt;SPAN&gt;SWITCH(TRUE(),&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;SUMX(&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;FILTER(FactSales,FORMAT(TwelveMonthsPrior,"YYYYMM")&amp;gt;FORMAT(FactSales[RevenueRecognitionDate],"YYYYMM")),&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;FactSales[Revenue]) &lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;lt;= 0 &lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;amp;&amp;amp; &lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;SUMX(&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;FILTER(FactSales,FORMAT(TwelveMonthsPrior,"YYYYMM")&amp;lt;=FORMAT(FactSales[RevenueRecognitionDate],"YYYYMM")),&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;FactSales[Revenue]) &lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;gt; 0, "NEW",&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;"OLD")&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;Thank you for your help!&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;</description>
      <pubDate>Fri, 09 Apr 2021 19:08:21 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Filtering-for-quot-NEW-quot-customers/m-p/1777637#M37276</guid>
      <dc:creator>cbolling</dc:creator>
      <dc:date>2021-04-09T19:08:21Z</dc:date>
    </item>
    <item>
      <title>Re: Filtering for "NEW" customers</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Filtering-for-quot-NEW-quot-customers/m-p/1777652#M37277</link>
      <description>&lt;P&gt;Hi,&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="246486" data-lia-user-login="cbolling" class="lia-mention lia-mention-user"&gt;cbolling&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Please correct me if I wrongly understood your question.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;In the measure,&lt;/P&gt;&lt;P&gt;VAR this quarter's customers list can be created&amp;nbsp;&lt;/P&gt;&lt;P&gt;VAR previous three quarters' customers' list can be created&lt;/P&gt;&lt;P&gt;VAR by using except DAX function, during 4 quarters, only the current quarter's customers list can be created.&lt;/P&gt;&lt;P&gt;By using this, new customer analysis can be performed.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;if it is OK with you, please share your sample pbix file's link here, then I can try to come up with a more accurate measure.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT face="”calibri" color="”#0000FF”"&gt;&lt;EM&gt;&lt;STRONG&gt;Hi, My name is Jihwan Kim. &lt;/STRONG&gt;&lt;/EM&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="”calibri" color="”#0000FF”"&gt;&lt;EM&gt;&lt;STRONG&gt;If this post helps, then please consider accept it as the solution to help other members find it faster, and give a big thumbs up.&lt;/STRONG&gt;&lt;/EM&gt;&lt;/FONT&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 09 Apr 2021 19:21:27 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Filtering-for-quot-NEW-quot-customers/m-p/1777652#M37277</guid>
      <dc:creator>Jihwan_Kim</dc:creator>
      <dc:date>2021-04-09T19:21:27Z</dc:date>
    </item>
    <item>
      <title>Re: Filtering for "NEW" customers</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Filtering-for-quot-NEW-quot-customers/m-p/1777714#M37283</link>
      <description>&lt;P&gt;Unfortunately we do not have a sample PBIX file that we can give you, but would you please expand on the above variables that you would create?&lt;BR /&gt;&lt;BR /&gt;From my understanding, you would do the following:&lt;BR /&gt;&lt;BR /&gt;VAR QuarterToDateSales (I have this measure created in my PBIX file)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;VAR PreviousThreeQuarterSales (I do not know how to calculate this, I wiuld love it if you could show me how to do this one)&lt;BR /&gt;&lt;BR /&gt;And then you would somehow say, If sales for all quarters except the current and previous quarters is zero, then customer is new.&lt;BR /&gt;&lt;BR /&gt;Please help by providing possible sample DAX.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you!&lt;/P&gt;</description>
      <pubDate>Fri, 09 Apr 2021 20:43:37 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Filtering-for-quot-NEW-quot-customers/m-p/1777714#M37283</guid>
      <dc:creator>cbolling</dc:creator>
      <dc:date>2021-04-09T20:43:37Z</dc:date>
    </item>
    <item>
      <title>Re: Filtering for "NEW" customers</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Filtering-for-quot-NEW-quot-customers/m-p/1777769#M37288</link>
      <description>&lt;LI-CODE lang="csharp"&gt;// Let's assume that you have a HIDDEN column
// called [CalendarYearQtrID] in
// your DimDate table. This is an int
// that numbers quarters in all years
// sequentially without gaps. It starts
// with 1 and goes up to the very number
// of quarters you have in your table.
// It's not 1, 2, 3, 4 only. It goes up
// and can even be 20 if the number of
// quarters in the table is &amp;gt;= 20.

[Customer Type] =
// This returns a value if one and only one
// customer is visible in the current context.
if( HASONEVALUE( Customer[CustomerID] ),
    
    var vCurrentQtrID = MAX( DimDate[CalendarYearQtrID] )
    var vMaxVisibleDate = MAX( DimDate[Date] )
    var vSalesWithinLast3QtrsPlusQTD =
        CALCULATE(
            [Sales],
            DimDate[CalendarYearQtrID] &amp;lt;= vCurrentQtrID,
            DimDate[CalendarYearQtrID] &amp;gt;= vCurrentQtrID - 3,
            DimDate[Date] &amp;lt;= vMaxVisibleDate
        )
    var vSalesBeforeLast3QtrsPlusQTD =
        CALCULATE(
            [Sales],
            DimDate[CalendarYearQtrID] &amp;lt; vCurrentQtrID - 3,
            REMOVEFILTERS( DimDate )
        )
    var vNewCustomer =
        vSalesWithinLast3QtrsPlusQTD &amp;gt; 0
        &amp;amp;&amp;amp;
        vSalesBeforeLast3QtrsPlusQTD &amp;lt;= 0
    return
        IF( vNewCustomer,
            "New",
            "Old"
        )
)&lt;/LI-CODE&gt;</description>
      <pubDate>Fri, 09 Apr 2021 22:33:59 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Filtering-for-quot-NEW-quot-customers/m-p/1777769#M37288</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2021-04-09T22:33:59Z</dc:date>
    </item>
    <item>
      <title>Re: Filtering for "NEW" customers</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Filtering-for-quot-NEW-quot-customers/m-p/1777868#M37291</link>
      <description>&lt;P&gt;Hi,&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="246486" data-lia-user-login="cbolling" class="lia-mention lia-mention-user"&gt;cbolling&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I tried to create the sample by myself, however, the sample is a weekly basis. I could not create the quarterly basis sample.&lt;/P&gt;&lt;P&gt;But I hope you can easily follow the steps and concept of how I created the below table.&lt;/P&gt;&lt;P&gt;Please keep in mind that, in my sample, the week number is only within the same year. If you want to compare it with the previous year's week, the formula has to be a little bit different.&amp;nbsp;&lt;/P&gt;&lt;P&gt;The reason is that, in my sample, Week4 minus 8 weeks ago is not Week-4, but it is last year's week48.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;A href="https://www.dropbox.com/s/xzln25lbo7mnhwo/cbolling.pbix?dl=0" target="_self"&gt;https://www.dropbox.com/s/xzln25lbo7mnhwo/cbolling.pbix?dl=0&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT face="”calibri" color="”#0000FF”"&gt;&lt;EM&gt;&lt;STRONG&gt;Hi, My name is Jihwan Kim. &lt;/STRONG&gt;&lt;/EM&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="”calibri" color="”#0000FF”"&gt;&lt;EM&gt;&lt;STRONG&gt;If this post helps, then please consider accept it as the solution to help other members find it faster, and give a big thumbs up.&lt;/STRONG&gt;&lt;/EM&gt;&lt;/FONT&gt;&lt;/P&gt;</description>
      <pubDate>Sat, 10 Apr 2021 03:05:58 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Filtering-for-quot-NEW-quot-customers/m-p/1777868#M37291</guid>
      <dc:creator>Jihwan_Kim</dc:creator>
      <dc:date>2021-04-10T03:05:58Z</dc:date>
    </item>
    <item>
      <title>Re: Filtering for "NEW" customers</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Filtering-for-quot-NEW-quot-customers/m-p/1780672#M37389</link>
      <description>&lt;P&gt;Thank you for your help! I will take a look!&lt;/P&gt;</description>
      <pubDate>Mon, 12 Apr 2021 16:15:49 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Filtering-for-quot-NEW-quot-customers/m-p/1780672#M37389</guid>
      <dc:creator>cbolling</dc:creator>
      <dc:date>2021-04-12T16:15:49Z</dc:date>
    </item>
  </channel>
</rss>

