<?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: Concatenate or Combine rows based on column condition in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Concatenate-or-Combine-rows-based-on-column-condition/m-p/2572561#M73531</link>
    <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="330241" data-lia-user-login="bmk" class="lia-mention lia-mention-user"&gt;bmk&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I think I have a solution in Power Query:&lt;BR /&gt;&lt;BR /&gt;Before:&lt;/P&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;After:&lt;/P&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Here the code in Power Query M that you can paste into the advanced editor (if you do not know, how to exactly do this, please check out &lt;A style="margin-right: 5px;" href="https://www.tackytech.blog/how-to-use-power-querys-advanced-editor/" rel="nofollow noopener noreferrer" target="_blank"&gt;this quick walkthrough&lt;/A&gt;)&lt;/P&gt;
&lt;PRE&gt;let
    Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45WCg1W0lEyMjYxNQPSZvqGBvpGBkZGCmZWxgZAgZDKglRDEJ2RWawARIkKJanFJUqxOsRoNCJXozG5Gk3I1WiKRWMsAA==", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [Location = _t, #"Item Nunber" = _t, #"Date of ocurrence" = _t, Type = _t, Description = _t]),
    #"Changed Type" = Table.TransformColumnTypes(Source,{{"Location", type text}, {"Item Nunber", Int64.Type}, {"Date of ocurrence", type datetime}, {"Type", type text}, {"Description", type text}}),
    #"Goup By" = Table.Group(#"Changed Type", {"Location", "Item Nunber", "Date of ocurrence", "Description"}, {{"Type", each Text.Combine(List.Transform(_[Type], (x) =&amp;gt; Value.FromText(x)), ", "), type text}})

in
    #"Goup By"&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Let me know if this helps &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;/Tom&lt;BR /&gt;&lt;A href="https://www.tackytech.blog/" target="_blank" rel="noopener"&gt;https://www.tackytech.blog/&lt;/A&gt;&lt;BR /&gt;&lt;A href="https://www.instagram.com/tackytechtom/" target="_blank" rel="noopener"&gt;https://www.instagram.com/tackytechtom/&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Sat, 10 Feb 2024 14:01:25 GMT</pubDate>
    <dc:creator>tackytechtom</dc:creator>
    <dc:date>2024-02-10T14:01:25Z</dc:date>
    <item>
      <title>Concatenate or Combine rows based on column condition</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Concatenate-or-Combine-rows-based-on-column-condition/m-p/2572490#M73527</link>
      <description>&lt;P&gt;Scenario is shown in the below image.&lt;BR /&gt;&lt;BR /&gt;Is there a way to build a measure to concatenate values of column 'Type' based on condition i.e. distinct 'Item Number'?&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;</description>
      <pubDate>Fri, 10 Jun 2022 19:57:25 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Concatenate-or-Combine-rows-based-on-column-condition/m-p/2572490#M73527</guid>
      <dc:creator>bmk</dc:creator>
      <dc:date>2022-06-10T19:57:25Z</dc:date>
    </item>
    <item>
      <title>Re: Concatenate or Combine rows based on column condition</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Concatenate-or-Combine-rows-based-on-column-condition/m-p/2572561#M73531</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="330241" data-lia-user-login="bmk" class="lia-mention lia-mention-user"&gt;bmk&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I think I have a solution in Power Query:&lt;BR /&gt;&lt;BR /&gt;Before:&lt;/P&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;After:&lt;/P&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Here the code in Power Query M that you can paste into the advanced editor (if you do not know, how to exactly do this, please check out &lt;A style="margin-right: 5px;" href="https://www.tackytech.blog/how-to-use-power-querys-advanced-editor/" rel="nofollow noopener noreferrer" target="_blank"&gt;this quick walkthrough&lt;/A&gt;)&lt;/P&gt;
&lt;PRE&gt;let
    Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45WCg1W0lEyMjYxNQPSZvqGBvpGBkZGCmZWxgZAgZDKglRDEJ2RWawARIkKJanFJUqxOsRoNCJXozG5Gk3I1WiKRWMsAA==", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [Location = _t, #"Item Nunber" = _t, #"Date of ocurrence" = _t, Type = _t, Description = _t]),
    #"Changed Type" = Table.TransformColumnTypes(Source,{{"Location", type text}, {"Item Nunber", Int64.Type}, {"Date of ocurrence", type datetime}, {"Type", type text}, {"Description", type text}}),
    #"Goup By" = Table.Group(#"Changed Type", {"Location", "Item Nunber", "Date of ocurrence", "Description"}, {{"Type", each Text.Combine(List.Transform(_[Type], (x) =&amp;gt; Value.FromText(x)), ", "), type text}})

in
    #"Goup By"&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Let me know if this helps &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;/Tom&lt;BR /&gt;&lt;A href="https://www.tackytech.blog/" target="_blank" rel="noopener"&gt;https://www.tackytech.blog/&lt;/A&gt;&lt;BR /&gt;&lt;A href="https://www.instagram.com/tackytechtom/" target="_blank" rel="noopener"&gt;https://www.instagram.com/tackytechtom/&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 10 Feb 2024 14:01:25 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Concatenate-or-Combine-rows-based-on-column-condition/m-p/2572561#M73531</guid>
      <dc:creator>tackytechtom</dc:creator>
      <dc:date>2024-02-10T14:01:25Z</dc:date>
    </item>
    <item>
      <title>Re: Concatenate or Combine rows based on column condition</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Concatenate-or-Combine-rows-based-on-column-condition/m-p/2572617#M73538</link>
      <description>&lt;P&gt;If it is many to one relationship,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;ITEMS = ConcatenateX(RELATEDTABLE(order_goods),order_goods[item],UNICHAR(10),order_goods[item])&lt;/P&gt;&lt;P&gt;UNICHAR(10) means start new line.&lt;/P&gt;</description>
      <pubDate>Fri, 10 Jun 2022 23:03:10 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Concatenate-or-Combine-rows-based-on-column-condition/m-p/2572617#M73538</guid>
      <dc:creator>vapid128</dc:creator>
      <dc:date>2022-06-10T23:03:10Z</dc:date>
    </item>
    <item>
      <title>Re: Concatenate or Combine rows based on column condition</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Concatenate-or-Combine-rows-based-on-column-condition/m-p/2572781#M73559</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="330241" data-lia-user-login="bmk" class="lia-mention lia-mention-user"&gt;bmk&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I guess you are slicing by Location and Item Number. Then you can use&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;Types =
CONCATENATEX (
    VALUES ( TableName[Type] ),
    TableName[Type],
    UNICHAR ( 10 ),
    TableName[Type], ASC
)&lt;/LI-CODE&gt;</description>
      <pubDate>Sat, 11 Jun 2022 08:52:03 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Concatenate-or-Combine-rows-based-on-column-condition/m-p/2572781#M73559</guid>
      <dc:creator>tamerj1</dc:creator>
      <dc:date>2022-06-11T08:52:03Z</dc:date>
    </item>
    <item>
      <title>Re: Concatenate or Combine rows based on column condition</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Concatenate-or-Combine-rows-based-on-column-condition/m-p/2573440#M73612</link>
      <description>&lt;P&gt;Hello tomfox,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you. This technically worked well. Except for scenarios wherein the 'type' column have same values.&lt;BR /&gt;In which case I would need the distinct values to be concatenated, since currently it is being duplicated.&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;BR /&gt;&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;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 13 Jun 2022 03:24:47 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Concatenate-or-Combine-rows-based-on-column-condition/m-p/2573440#M73612</guid>
      <dc:creator>bmk</dc:creator>
      <dc:date>2022-06-13T03:24:47Z</dc:date>
    </item>
    <item>
      <title>Re: Concatenate or Combine rows based on column condition</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Concatenate-or-Combine-rows-based-on-column-condition/m-p/2573443#M73613</link>
      <description>&lt;P&gt;I just wrapped the list.transform function with list.distinct and it workas required. Please let me know if I need to keep anything in mind from an error handling perspective. Thank you!&lt;/P&gt;</description>
      <pubDate>Mon, 13 Jun 2022 03:25:10 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Concatenate-or-Combine-rows-based-on-column-condition/m-p/2573443#M73613</guid>
      <dc:creator>bmk</dc:creator>
      <dc:date>2022-06-13T03:25:10Z</dc:date>
    </item>
  </channel>
</rss>

