<?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: IN / OUT strings labels versus last year in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/IN-OUT-strings-labels-versus-last-year/m-p/2613173#M75845</link>
    <description>&lt;P&gt;Hi&amp;nbsp;Anonymous&lt;/LI-USER&gt;&amp;nbsp;,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;I created a similar table as below.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;You can follow my method:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Here is the DAX:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;left =

VAR _curr =

    SUMMARIZE (

        FILTER (

            ALL ( 'Sheet1' ),

            YEAR ( [date] ) = MAX ( 'Sheet1'[date].[Year] )

                &amp;amp;&amp;amp; MONTH ( [date] ) = MAX ( 'Sheet1'[date].[MonthNo] )

        ),

        [brand]

    )

VAR _pre =

    SUMMARIZE (

        FILTER (

            ALL ( 'Sheet1' ),

            YEAR ( [date] )

                = MAX ( 'Sheet1'[date].[Year] ) - 1

                &amp;amp;&amp;amp; MONTH ( [date] ) = MAX ( 'Sheet1'[date].[MonthNo] )

        ),

        [brand]

    )

VAR _left =

    EXCEPT ( _pre, _curr )

RETURN

CONCATENATEX ( _left, [brand], "," )

 

joined =

VAR _curr =

    SUMMARIZE (

        FILTER (

            ALL ( 'Sheet1' ),

            YEAR ( [date] ) = MAX ( 'Sheet1'[date].[Year] )

                &amp;amp;&amp;amp; MONTH ( [date] ) = MAX ( 'Sheet1'[date].[MonthNo] )

        ),

        [brand]

    )

VAR _pre =

    SUMMARIZE (

        FILTER (

            ALL ( 'Sheet1' ),

            YEAR ( [date] )

                = MAX ( 'Sheet1'[date].[Year] ) - 1

                &amp;amp;&amp;amp; MONTH ( [date] ) = MAX ( 'Sheet1'[date].[MonthNo] )

        ),

        [brand]

    )

VAR _joined =

    EXCEPT ( _curr, _pre )

RETURN

CONCATENATEX ( _joined, [brand], "," )&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Output:&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;Best Regards,&lt;/P&gt;&lt;P&gt;Jianbo Li&lt;/P&gt;&lt;P&gt;If this post &lt;STRONG&gt;&lt;EM&gt;helps&lt;/EM&gt;&lt;/STRONG&gt;, then please consider &lt;STRONG&gt;&lt;EM&gt;Accept it as the solution&lt;/EM&gt;&lt;/STRONG&gt; to help the other members find it more quickly.&lt;/P&gt;</description>
    <pubDate>Fri, 01 Jul 2022 03:21:25 GMT</pubDate>
    <dc:creator>v-jianboli-msft</dc:creator>
    <dc:date>2022-07-01T03:21:25Z</dc:date>
    <item>
      <title>IN / OUT strings labels versus last year</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/IN-OUT-strings-labels-versus-last-year/m-p/2604247#M75363</link>
      <description>&lt;P&gt;Hello,&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have data that have a month filter and around 92 brands names.&amp;nbsp;&lt;/P&gt;&lt;P&gt;We want to automatize a dashboard that has the new comers of the brands and the ones who left comparing the last year month.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;As it shown bellow :&amp;nbsp;&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;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The dashboard has to display in filtering May 2022 for example : "Gucci" left the group brands, "Comets" joined the group brands.&lt;BR /&gt;&lt;BR /&gt;Does anyone can suggest an idea through DAX ?&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;Many thanks,&lt;/P&gt;</description>
      <pubDate>Tue, 28 Jun 2022 12:57:20 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/IN-OUT-strings-labels-versus-last-year/m-p/2604247#M75363</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2022-06-28T12:57:20Z</dc:date>
    </item>
    <item>
      <title>Re: IN / OUT strings labels versus last year</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/IN-OUT-strings-labels-versus-last-year/m-p/2604769#M75383</link>
      <description>&lt;P&gt;Anonymous&lt;/LI-USER&gt; , the Same formula's as customer retention can work . You can use datesyd &lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;or&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;year behind measure for last year&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&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;Customer Retention Part 1:&lt;BR /&gt;&lt;A href="https://community.powerbi.com/t5/Community-Blog/Customer-Retention-Part-1-Month-on-Month-Retention/ba-p/1361529" target="_blank"&gt;https://community.powerbi.com/t5/Community-Blog/Customer-Retention-Part-1-Month-on-Month-Retention/ba-p/1361529&lt;/A&gt;&lt;BR /&gt;Customer Retention Part 2: Period over Period Retention:&lt;A href="https://community.powerbi.com/t5/Community-Blog/Customer-Retention-Part-2-Period-over-Period-Retention/ba-p/1377458" target="_blank"&gt;https://community.powerbi.com/t5/Community-Blog/Customer-Retention-Part-2-Period-over-Period-Retention/ba-p/1377458&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 27 Jun 2022 16:49:11 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/IN-OUT-strings-labels-versus-last-year/m-p/2604769#M75383</guid>
      <dc:creator>amitchandak</dc:creator>
      <dc:date>2022-06-27T16:49:11Z</dc:date>
    </item>
    <item>
      <title>Re: IN / OUT strings labels versus last year</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/IN-OUT-strings-labels-versus-last-year/m-p/2604981#M75397</link>
      <description>&lt;P&gt;Hello&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="148838" data-lia-user-login="amitchandak" class="lia-mention lia-mention-user"&gt;amitchandak&lt;/a&gt;&amp;nbsp;-&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;What expression would you use if no Sales exists?&lt;/P&gt;&lt;P&gt;What if the only 2 columns are simply: Date &amp;amp; Brand?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;How do we identify a Brand GAINED and a Brand Lost?&lt;/P&gt;&lt;P&gt;The underlined SUM(EXPRESSION) below would need to be replaced, but with what?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;CALCULATE(&lt;U&gt;&lt;STRONG&gt;SUM(Sales[Sales Amount])&lt;/STRONG&gt;&lt;/U&gt;,dateadd('Date'[Date],-1,Year))&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Thanks for the help.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Nathan&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 27 Jun 2022 19:08:24 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/IN-OUT-strings-labels-versus-last-year/m-p/2604981#M75397</guid>
      <dc:creator>WinterMist</dc:creator>
      <dc:date>2022-06-27T19:08:24Z</dc:date>
    </item>
    <item>
      <title>Re: IN / OUT strings labels versus last year</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/IN-OUT-strings-labels-versus-last-year/m-p/2606309#M75468</link>
      <description>&lt;P&gt;As&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="340078" data-lia-user-login="WinterMist" class="lia-mention lia-mention-user"&gt;WinterMist&lt;/a&gt;&amp;nbsp;said .What should we do if there's no sales column ?&amp;nbsp;&lt;/P&gt;&lt;P&gt;The dax formulas you suggested can be applied only for numeric values.&amp;nbsp;&lt;/P&gt;&lt;P&gt;My question is how to implement the same idea but in strings values ?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Knowing that Max(stirng_value) and Min(string_value) doesn't give the same result in a CALCULATE function comparing with the SUM.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you.&lt;/P&gt;</description>
      <pubDate>Tue, 28 Jun 2022 09:25:37 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/IN-OUT-strings-labels-versus-last-year/m-p/2606309#M75468</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2022-06-28T09:25:37Z</dc:date>
    </item>
    <item>
      <title>Re: IN / OUT strings labels versus last year</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/IN-OUT-strings-labels-versus-last-year/m-p/2613173#M75845</link>
      <description>&lt;P&gt;Hi&amp;nbsp;Anonymous&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;I created a similar table as below.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;You can follow my method:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Here is the DAX:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;left =

VAR _curr =

    SUMMARIZE (

        FILTER (

            ALL ( 'Sheet1' ),

            YEAR ( [date] ) = MAX ( 'Sheet1'[date].[Year] )

                &amp;amp;&amp;amp; MONTH ( [date] ) = MAX ( 'Sheet1'[date].[MonthNo] )

        ),

        [brand]

    )

VAR _pre =

    SUMMARIZE (

        FILTER (

            ALL ( 'Sheet1' ),

            YEAR ( [date] )

                = MAX ( 'Sheet1'[date].[Year] ) - 1

                &amp;amp;&amp;amp; MONTH ( [date] ) = MAX ( 'Sheet1'[date].[MonthNo] )

        ),

        [brand]

    )

VAR _left =

    EXCEPT ( _pre, _curr )

RETURN

CONCATENATEX ( _left, [brand], "," )

 

joined =

VAR _curr =

    SUMMARIZE (

        FILTER (

            ALL ( 'Sheet1' ),

            YEAR ( [date] ) = MAX ( 'Sheet1'[date].[Year] )

                &amp;amp;&amp;amp; MONTH ( [date] ) = MAX ( 'Sheet1'[date].[MonthNo] )

        ),

        [brand]

    )

VAR _pre =

    SUMMARIZE (

        FILTER (

            ALL ( 'Sheet1' ),

            YEAR ( [date] )

                = MAX ( 'Sheet1'[date].[Year] ) - 1

                &amp;amp;&amp;amp; MONTH ( [date] ) = MAX ( 'Sheet1'[date].[MonthNo] )

        ),

        [brand]

    )

VAR _joined =

    EXCEPT ( _curr, _pre )

RETURN

CONCATENATEX ( _joined, [brand], "," )&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Output:&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;Best Regards,&lt;/P&gt;&lt;P&gt;Jianbo Li&lt;/P&gt;&lt;P&gt;If this post &lt;STRONG&gt;&lt;EM&gt;helps&lt;/EM&gt;&lt;/STRONG&gt;, then please consider &lt;STRONG&gt;&lt;EM&gt;Accept it as the solution&lt;/EM&gt;&lt;/STRONG&gt; to help the other members find it more quickly.&lt;/P&gt;</description>
      <pubDate>Fri, 01 Jul 2022 03:21:25 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/IN-OUT-strings-labels-versus-last-year/m-p/2613173#M75845</guid>
      <dc:creator>v-jianboli-msft</dc:creator>
      <dc:date>2022-07-01T03:21:25Z</dc:date>
    </item>
    <item>
      <title>Re: IN / OUT strings labels versus last year</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/IN-OUT-strings-labels-versus-last-year/m-p/2614252#M75893</link>
      <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="403972" data-lia-user-login="v-jianboli-msft" class="lia-mention lia-mention-user"&gt;v-jianboli-msft&lt;/a&gt;&amp;nbsp;Thank you so much for your help, the code is very genius &lt;span class="lia-unicode-emoji" title=":winking_face:"&gt;😉&lt;/span&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 01 Jul 2022 12:47:23 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/IN-OUT-strings-labels-versus-last-year/m-p/2614252#M75893</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2022-07-01T12:47:23Z</dc:date>
    </item>
  </channel>
</rss>

