<?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: Regroup in one line a TEXT value according to a list of lines (which function(s))? in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Regroup-in-one-line-a-TEXT-value-according-to-a-list-of-lines/m-p/3781734#M147744</link>
    <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="680367" data-lia-user-login="Julbak" class="lia-mention lia-mention-user"&gt;Julbak&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks for the reply from &lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="100342" data-lia-user-login="lbendlin" class="lia-mention lia-mention-user"&gt;lbendlin&lt;/a&gt;&amp;nbsp;, please allow me to provide detailed description:&lt;BR /&gt;First of all, I create a set of sample data:&lt;/P&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;P&gt;Then add a index(from 1) column in power query:&lt;/P&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;P&gt;Then add a calculate column:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;Column =
VAR _PerviousIndex =
    CALCULATE (
        MAX ( 'Table'[Index] ),
        FILTER (
            ALLSELECTED ( 'Table' ),
            'Table'[Index]
                = EARLIER ( 'Table'[Index] ) + 1
        )
    )
VAR _PerviousLaize =
    CALCULATE (
        SELECTEDVALUE ( 'Table'[Laize] ),
        FILTER ( ALLSELECTED ( 'Table' ), 'Table'[Index] = _PerviousIndex )
    )
RETURN
    IF ( 'Table'[Laize] &amp;lt;&amp;gt; _PerviousLaize, 'Table'[Index] )
&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;P&gt;Next, create a new table:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;Table 2 =
VAR _newTable =
    SUMMARIZE (
        FILTER ( 'Table', 'Table'[Column] &amp;lt;&amp;gt; BLANK () ),
        'Table'[Laize],
        'Table'[Column]
    )
RETURN
    SELECTCOLUMNS (
        _newTable,
        "Laize1", [Laize],
        "Count",
            (
                [Column]
                    - MAXX ( FILTER ( _newTable, [Column] &amp;lt; EARLIER ( 'Table'[Column] ) ), [Column] )
            ) &amp;amp; "*" &amp;amp; [Laize]
    )&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;P&gt;Finally, add a measure:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;Measure = CONCATENATEX('Table 2','Table 2'[Count],"+")&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The result is as follow:&lt;/P&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Best Regards&lt;/P&gt;
&lt;P&gt;Zhengdong Xu&lt;BR /&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 it as the solution&lt;/EM&gt;&lt;/STRONG&gt;&lt;EM&gt;&amp;nbsp;to help the other members find it more quickly.&lt;/EM&gt;&lt;/P&gt;</description>
    <pubDate>Wed, 27 Mar 2024 01:38:57 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2024-03-27T01:38:57Z</dc:date>
    <item>
      <title>Regroup in one line a TEXT value according to a list of lines (which function(s))?</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Regroup-in-one-line-a-TEXT-value-according-to-a-list-of-lines/m-p/3779793#M147690</link>
      <description>&lt;P&gt;Hello Community,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am searching a solution to regroup a set of lines into one line in Power BI using DAX.&lt;/P&gt;&lt;P&gt;Example of one case:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;How it works:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;For &lt;STRONG&gt;1 passage&lt;/STRONG&gt; (in this case the number #7 for the column "passage") I have got a mapping of cutting explained in the "End point" column.&lt;/P&gt;&lt;P&gt;The idea is to regroup automatically in one line the "cutting map" based on one passage.&lt;/P&gt;&lt;P&gt;For example here:&amp;nbsp;&lt;/P&gt;&lt;P&gt;The line (TEXT) I want to get is: "&lt;STRONG&gt;2x87 + 22x66 + 10 x 87 + 12 x 66&lt;/STRONG&gt;"&lt;/P&gt;&lt;P&gt;The order is based by the End Point column (that represents from left to right) the position of the different rolls with the "Laize" that is the width actually.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Example: 2x87 means 2 rolls of 87mm width then 22 rolls of 66mm witdh then... (from let to right) but row to row in the table.&lt;/P&gt;&lt;P&gt;I tried to use different fonctions to get this line but I have never been accustomed of that in Power Bi so I am freezing &lt;span class="lia-unicode-emoji" title=":grinning_face_with_smiling_eyes:"&gt;😄&lt;/span&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks for your advice with what kind of DAX formula I can use to get this &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Julien&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 20 Mar 2024 14:30:17 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Regroup-in-one-line-a-TEXT-value-according-to-a-list-of-lines/m-p/3779793#M147690</guid>
      <dc:creator>Julbak</dc:creator>
      <dc:date>2024-03-20T14:30:17Z</dc:date>
    </item>
    <item>
      <title>Re: Regroup in one line a TEXT value according to a list of lines (which function(s))?</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Regroup-in-one-line-a-TEXT-value-according-to-a-list-of-lines/m-p/3780791#M147719</link>
      <description>&lt;P&gt;Usually CONCATENATEX can do that.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Please provide sample data that covers your issue or question &lt;STRONG&gt;completely&lt;/STRONG&gt;, in a &lt;STRONG&gt;usable&lt;/STRONG&gt; format (not as a screenshot).&lt;BR /&gt;&lt;BR /&gt;Do not include sensitive information or anything not related to the issue or question. &lt;BR /&gt;&lt;BR /&gt;If you are unsure how to upload data please refer to &lt;A href="https://community.fabric.microsoft.com/t5/Community-Blog/How-to-provide-sample-data-in-the-Power-BI-Forum/ba-p/963216" target="_blank"&gt;https://community.fabric.microsoft.com/t5/Community-Blog/How-to-provide-sample-data-in-the-Power-BI-Forum/ba-p/963216&lt;/A&gt; &lt;BR /&gt;&lt;BR /&gt;Please show the expected outcome based on the sample data you provided. &lt;BR /&gt;&lt;BR /&gt;Want faster answers? &lt;A href="https://community.fabric.microsoft.com/t5/Desktop/How-to-Get-Your-Question-Answered-Quickly/m-p/1447523" target="_blank"&gt;https://community.fabric.microsoft.com/t5/Desktop/How-to-Get-Your-Question-Answered-Quickly/m-p/1447523&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 20 Mar 2024 22:17:19 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Regroup-in-one-line-a-TEXT-value-according-to-a-list-of-lines/m-p/3780791#M147719</guid>
      <dc:creator>lbendlin</dc:creator>
      <dc:date>2024-03-20T22:17:19Z</dc:date>
    </item>
    <item>
      <title>Re: Regroup in one line a TEXT value according to a list of lines (which function(s))?</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Regroup-in-one-line-a-TEXT-value-according-to-a-list-of-lines/m-p/3781734#M147744</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="680367" data-lia-user-login="Julbak" class="lia-mention lia-mention-user"&gt;Julbak&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks for the reply from &lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="100342" data-lia-user-login="lbendlin" class="lia-mention lia-mention-user"&gt;lbendlin&lt;/a&gt;&amp;nbsp;, please allow me to provide detailed description:&lt;BR /&gt;First of all, I create a set of sample data:&lt;/P&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;P&gt;Then add a index(from 1) column in power query:&lt;/P&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;P&gt;Then add a calculate column:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;Column =
VAR _PerviousIndex =
    CALCULATE (
        MAX ( 'Table'[Index] ),
        FILTER (
            ALLSELECTED ( 'Table' ),
            'Table'[Index]
                = EARLIER ( 'Table'[Index] ) + 1
        )
    )
VAR _PerviousLaize =
    CALCULATE (
        SELECTEDVALUE ( 'Table'[Laize] ),
        FILTER ( ALLSELECTED ( 'Table' ), 'Table'[Index] = _PerviousIndex )
    )
RETURN
    IF ( 'Table'[Laize] &amp;lt;&amp;gt; _PerviousLaize, 'Table'[Index] )
&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;P&gt;Next, create a new table:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;Table 2 =
VAR _newTable =
    SUMMARIZE (
        FILTER ( 'Table', 'Table'[Column] &amp;lt;&amp;gt; BLANK () ),
        'Table'[Laize],
        'Table'[Column]
    )
RETURN
    SELECTCOLUMNS (
        _newTable,
        "Laize1", [Laize],
        "Count",
            (
                [Column]
                    - MAXX ( FILTER ( _newTable, [Column] &amp;lt; EARLIER ( 'Table'[Column] ) ), [Column] )
            ) &amp;amp; "*" &amp;amp; [Laize]
    )&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;P&gt;Finally, add a measure:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;Measure = CONCATENATEX('Table 2','Table 2'[Count],"+")&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The result is as follow:&lt;/P&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Best Regards&lt;/P&gt;
&lt;P&gt;Zhengdong Xu&lt;BR /&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 it as the solution&lt;/EM&gt;&lt;/STRONG&gt;&lt;EM&gt;&amp;nbsp;to help the other members find it more quickly.&lt;/EM&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 27 Mar 2024 01:38:57 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Regroup-in-one-line-a-TEXT-value-according-to-a-list-of-lines/m-p/3781734#M147744</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2024-03-27T01:38:57Z</dc:date>
    </item>
  </channel>
</rss>

