<?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 get YoY change based on Customer types of this year? in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-get-YoY-change-based-on-Customer-types-of-this-year/m-p/2907761#M94919</link>
    <description>&lt;P&gt;Hi Aniya, Thank you for reply! I had a busy weekend, so I couldn't answer your question immediately, apologize!&lt;BR /&gt;I have total sales from Januar 2020 to November 2022. I want to calculate the YoY change of Single customer fron Januar 2020 to November 2022. I'm doing Net retention analysis, so each customer has their own Tagging ( Customer Status: New Customers, Growing Customers, Churned customers and Declining customers).&lt;BR /&gt;Measure this year = Total Sales&lt;BR /&gt;Measure last year = calculate (Total sales, sameperiodlastyear(output[period].[date]))&lt;BR /&gt;YoY change = measure this year - measure last year.&lt;/P&gt;&lt;P&gt;At the end I want have a matrix: Tagging (customer status) as first category column, period.[date] as horizontal column and YoY change as value in the matrix. The customer status will be determined every month. So there are many Taggings for a certain customer. If I use last month Tagging as the Tagging for each customer in the whole period, the result is not correct, especially for new customers.&lt;BR /&gt;There are two problems:&lt;BR /&gt;1) if use customer status&lt;BR /&gt;should I use last month Tagging?&lt;BR /&gt;2)My idea was that using last month Tagging to determine customer status for each customer. Then calculate YoY change of these customer regardless their customer status. However, If I use customer status for measure this year, then it will affect also measure last year and YoY change.&lt;/P&gt;&lt;P&gt;I'm a bit confused about if my idea is correct or not. Please help me with this problem, I'll appriciate for any help you can provide! &lt;span class="lia-unicode-emoji" title=":folded_hands:"&gt;🙏&lt;/span&gt;&lt;/P&gt;</description>
    <pubDate>Tue, 15 Nov 2022 20:55:05 GMT</pubDate>
    <dc:creator>BBZ221109</dc:creator>
    <dc:date>2022-11-15T20:55:05Z</dc:date>
    <item>
      <title>How to get YoY change based on Customer types of this year?</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-get-YoY-change-based-on-Customer-types-of-this-year/m-p/2895617#M94118</link>
      <description>&lt;P&gt;Hi everyone, I'm very new to DAX-world. Please help me, and I'm struggling with a filter problem; Currently, I'm doing a customer retention analysis. Every customer may have different tagging of customer types( New customers, Growing customers, Declining customers, or Churned customers). I determined the tagging of the last month as customer types for each customer; let's called it Last_month_tagging. See the matrix below:&amp;nbsp;&lt;/P&gt;&lt;TABLE&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;Last_month_tagging&lt;/TD&gt;&lt;TD&gt;Sales of this year&lt;/TD&gt;&lt;TD&gt;Sales of last year&amp;nbsp;&lt;/TD&gt;&lt;TD&gt;YoY change&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;New Customers&amp;nbsp;&lt;/TD&gt;&lt;TD&gt;100&lt;/TD&gt;&lt;TD&gt;0&lt;/TD&gt;&lt;TD&gt;100&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;Growing Customers&lt;/TD&gt;&lt;TD&gt;500&lt;/TD&gt;&lt;TD&gt;250&lt;/TD&gt;&lt;TD&gt;250&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;Declining Customers&amp;nbsp;&lt;/TD&gt;&lt;TD&gt;200&lt;/TD&gt;&lt;TD&gt;300&lt;/TD&gt;&lt;TD&gt;-100&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;Churned Customers&amp;nbsp;&lt;/TD&gt;&lt;TD&gt;0&lt;/TD&gt;&lt;TD&gt;100&lt;/TD&gt;&lt;TD&gt;-100&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;Total&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;TD&gt;150&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;I want to use the last_month_tagging to determine the customer names and their sales for this year, and I want to get the sales of last year from the same customers from this year, which means the measure sales last year should not be affected by column last_month_tagging. YoY change is the sales difference of the same customers, and it should also not&amp;nbsp;affect by column last_month_tagging.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;However, using last_month_tagging, Power BI will deliver the sales of last year based on last_month_tagging instead of customer names. I appreciate any help you can provide!&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 09 Nov 2022 14:52:27 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-get-YoY-change-based-on-Customer-types-of-this-year/m-p/2895617#M94118</guid>
      <dc:creator>BBZ221109</dc:creator>
      <dc:date>2022-11-09T14:52:27Z</dc:date>
    </item>
    <item>
      <title>Re: How to get YoY change based on Customer types of this year?</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-get-YoY-change-based-on-Customer-types-of-this-year/m-p/2896497#M94200</link>
      <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="469397" data-lia-user-login="BBZ221109" class="lia-mention lia-mention-user"&gt;BBZ221109&lt;/a&gt; , if tagging is a column then you can create YOY measure using calculations like &lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;YTD Sales = CALCULATE(SUM(Sales[Sales Amount]),DATESYTD('Date'[Date],"12/31"))&lt;BR /&gt;Last YTD Sales = CALCULATE(SUM(Sales[Sales Amount]),DATESYTD(dateadd('Date'[Date],-1,Year),"12/31"))&lt;BR /&gt;This year Sales = CALCULATE(SUM(Sales[Sales Amount]),DATESYTD(ENDOFYEAR('Date'[Date]),"12/31"))&lt;BR /&gt;Last year Sales = CALCULATE(SUM(Sales[Sales Amount]),DATESYTD(ENDOFYEAR(dateadd('Date'[Date],-1,Year)),"12/31"))&lt;BR /&gt;YTD Sales = CALCULATE(SUM(Sales[Sales Amount]),previousyear('Date'[Date]))&lt;BR /&gt;Last to last YTD Sales = CALCULATE(SUM(Sales[Sales Amount]),DATESYTD(dateadd('Date'[Date],-2,Year),"12/31"))&lt;BR /&gt;Year behind Sales = CALCULATE(SUM(Sales[Sales Amount]),dateadd('Date'[Date],-1,Year))&lt;BR /&gt;Year behind Sales = CALCULATE(SUM(Sales[Sales Amount]),SAMEPERIODLASTYEAR('Date'[Date]))&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;//Only year vs Year, not a level below&lt;/P&gt;
&lt;P&gt;This Year = CALCULATE(sum('Table'[Qty]),filter(ALL('Date'),'Date'[Year]=max('Date'[Year])))&lt;BR /&gt;Last Year = CALCULATE(sum('Table'[Qty]),filter(ALL('Date'),'Date'[Year]=max('Date'[Year])-1))&lt;BR /&gt;diff = [This Year]-[Last Year ]&lt;BR /&gt;diff % = divide([This Year]-[Last Year ],[Last Year ])&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;ore refer&lt;/P&gt;
&lt;P&gt;Customer Retention with Dynamic Segmentation, New/Lost/Retain Customer Count: &lt;A href="https://www.youtube.com/watch?v=W4EF1f_k6iY" target="_blank"&gt;https://www.youtube.com/watch?v=W4EF1f_k6iY&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;In this you have use the Year and Last year measure to sum , one type is finalized&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;example&lt;/P&gt;
&lt;P&gt;Sumx(filter( values(Customer[Customer]) , not(isblank([This Month])) &amp;amp;&amp;amp; not(isblank([Last Month])) ) , [This Year])&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Sumx(filter( values(Customer[Customer]) , not(isblank([This Month])) &amp;amp;&amp;amp; not(isblank([Last Month])) ) , [Last Year])&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 10 Nov 2022 02:32:57 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-get-YoY-change-based-on-Customer-types-of-this-year/m-p/2896497#M94200</guid>
      <dc:creator>amitchandak</dc:creator>
      <dc:date>2022-11-10T02:32:57Z</dc:date>
    </item>
    <item>
      <title>Re: How to get YoY change based on Customer types of this year?</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-get-YoY-change-based-on-Customer-types-of-this-year/m-p/2896572#M94205</link>
      <description>&lt;P&gt;Hi ，&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="469397" data-lia-user-login="BBZ221109" class="lia-mention lia-mention-user"&gt;BBZ221109&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Here are the steps you can refer to :&lt;BR /&gt;(1)This is my test data :&lt;/P&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;P&gt;(2)We can create three measure :&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;Sales of last year = var _t = FILTER( 'Customer' , YEAR('Customer'[Date])  = YEAR( TODAY())-1)
return
SUMX(_t , [Sales])+0&lt;/LI-CODE&gt;&lt;LI-CODE lang="markup"&gt;Sales of this year = var _t = FILTER( 'Customer' , YEAR('Customer'[Date])  = YEAR( TODAY()))
return
SUMX(_t , [Sales])+0&lt;/LI-CODE&gt;&lt;LI-CODE lang="markup"&gt;YoY change = [Sales of this year] - [Sales of last year]&lt;/LI-CODE&gt;
&lt;P&gt;(3)Then we can put these measure on the visual and then we can meet your need , the result is as follows:&lt;/P&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If this method does not meet your needs, you can provide us with your special &lt;STRONG&gt;sample data&lt;/STRONG&gt; and the &lt;STRONG&gt;desired output sample&lt;/STRONG&gt; data in the form of &lt;STRONG&gt;tables&lt;/STRONG&gt;, so that we can better help you solve the problem.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Best Regards,&lt;/P&gt;
&lt;P&gt;Aniya Zhang&lt;/P&gt;
&lt;P&gt;If this post&amp;nbsp;&lt;STRONG&gt;helps&lt;/STRONG&gt;, then please consider&amp;nbsp;&lt;STRONG&gt;&lt;EM&gt;Accept&lt;/EM&gt;&lt;/STRONG&gt;&lt;EM&gt; it as the solution&lt;/EM&gt;&amp;nbsp;to help the other members find it more quickly&lt;/P&gt;</description>
      <pubDate>Thu, 10 Nov 2022 03:47:29 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-get-YoY-change-based-on-Customer-types-of-this-year/m-p/2896572#M94205</guid>
      <dc:creator>v-yueyunzh-msft</dc:creator>
      <dc:date>2022-11-10T03:47:29Z</dc:date>
    </item>
    <item>
      <title>Re: How to get YoY change based on Customer types of this year?</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-get-YoY-change-based-on-Customer-types-of-this-year/m-p/2907761#M94919</link>
      <description>&lt;P&gt;Hi Aniya, Thank you for reply! I had a busy weekend, so I couldn't answer your question immediately, apologize!&lt;BR /&gt;I have total sales from Januar 2020 to November 2022. I want to calculate the YoY change of Single customer fron Januar 2020 to November 2022. I'm doing Net retention analysis, so each customer has their own Tagging ( Customer Status: New Customers, Growing Customers, Churned customers and Declining customers).&lt;BR /&gt;Measure this year = Total Sales&lt;BR /&gt;Measure last year = calculate (Total sales, sameperiodlastyear(output[period].[date]))&lt;BR /&gt;YoY change = measure this year - measure last year.&lt;/P&gt;&lt;P&gt;At the end I want have a matrix: Tagging (customer status) as first category column, period.[date] as horizontal column and YoY change as value in the matrix. The customer status will be determined every month. So there are many Taggings for a certain customer. If I use last month Tagging as the Tagging for each customer in the whole period, the result is not correct, especially for new customers.&lt;BR /&gt;There are two problems:&lt;BR /&gt;1) if use customer status&lt;BR /&gt;should I use last month Tagging?&lt;BR /&gt;2)My idea was that using last month Tagging to determine customer status for each customer. Then calculate YoY change of these customer regardless their customer status. However, If I use customer status for measure this year, then it will affect also measure last year and YoY change.&lt;/P&gt;&lt;P&gt;I'm a bit confused about if my idea is correct or not. Please help me with this problem, I'll appriciate for any help you can provide! &lt;span class="lia-unicode-emoji" title=":folded_hands:"&gt;🙏&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 15 Nov 2022 20:55:05 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-get-YoY-change-based-on-Customer-types-of-this-year/m-p/2907761#M94919</guid>
      <dc:creator>BBZ221109</dc:creator>
      <dc:date>2022-11-15T20:55:05Z</dc:date>
    </item>
    <item>
      <title>Re: How to get YoY change based on Customer types of this year?</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-get-YoY-change-based-on-Customer-types-of-this-year/m-p/2907763#M94920</link>
      <description>&lt;P&gt;Hi Admit!, Thank you for reply! I had a busy weekend, so I couldn't answer your question immediately, apologize!&lt;BR /&gt;I have total sales from Januar 2020 to November 2022. I want to calculate the YoY change of Single customer fron Januar 2020 to November 2022. I'm doing Net retention analysis, so each customer has their own Tagging ( Customer Status: New Customers, Growing Customers, Churned customers and Declining customers).&lt;BR /&gt;Measure this year = Total Sales&lt;BR /&gt;Measure last year = calculate (Total sales, sameperiodlastyear(output[period].[date]))&lt;BR /&gt;YoY change = measure this year - measure last year.&lt;/P&gt;&lt;P&gt;At the end I want have a matrix: Tagging (customer status) as first category column, period.[date] as horizontal column and YoY change as value in the matrix. The customer status will be determined every month. So there are many Taggings for a certain customer. If I use last month Tagging as the Tagging for each customer in the whole period, the result is not correct, especially for new customers.&lt;BR /&gt;There are two problems:&lt;BR /&gt;1) if use customer status&lt;BR /&gt;should I use last month Tagging?&lt;BR /&gt;2)My idea was that using last month Tagging to determine customer status for each customer. Then calculate YoY change of these customer regardless their customer status. However, If I use customer status for measure this year, then it will affect also measure last year and YoY change.&lt;/P&gt;&lt;P&gt;I'm a bit confused about if my idea is correct or not. Please help me with this problem, I'll appriciate for any help you can provide! &lt;span class="lia-unicode-emoji" title=":folded_hands:"&gt;🙏&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 15 Nov 2022 20:55:24 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-get-YoY-change-based-on-Customer-types-of-this-year/m-p/2907763#M94920</guid>
      <dc:creator>BBZ221109</dc:creator>
      <dc:date>2022-11-15T20:55:24Z</dc:date>
    </item>
    <item>
      <title>Re: How to get YoY change based on Customer types of this year?</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-get-YoY-change-based-on-Customer-types-of-this-year/m-p/2908203#M94954</link>
      <description>&lt;P&gt;Hi ,&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="469397" data-lia-user-login="BBZ221109" class="lia-mention lia-mention-user"&gt;BBZ221109&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;According to your description, a customer has many tagging, and you want to define the customer tagging on the last month. Right?&lt;/P&gt;
&lt;P&gt;If this , i think you can create a calculated column to define what is this customer tagging is in the whole period.&lt;/P&gt;
&lt;P&gt;Then we can put this custom column on the visual and we will filter the customers we need .&lt;/P&gt;
&lt;P&gt;If this method does not you need , can you share the sample data as a table and put what you want in the end as a table so that we can help you better.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Best Regards,&lt;/P&gt;
&lt;P&gt;Aniya Zhang&lt;/P&gt;
&lt;P&gt;If this post&amp;nbsp;&lt;STRONG&gt;helps&lt;/STRONG&gt;, then please consider&amp;nbsp;&lt;STRONG&gt;&lt;EM&gt;Accept&lt;/EM&gt;&lt;/STRONG&gt;&lt;EM&gt; it as the solution&lt;/EM&gt;&amp;nbsp;to help the other members find it more quickly&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 16 Nov 2022 03:55:40 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-get-YoY-change-based-on-Customer-types-of-this-year/m-p/2908203#M94954</guid>
      <dc:creator>v-yueyunzh-msft</dc:creator>
      <dc:date>2022-11-16T03:55:40Z</dc:date>
    </item>
  </channel>
</rss>

