<?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: Table.SelectRows when one column concatenated and the other is split into rows in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Table-SelectRows-when-one-column-concatenated-and-the-other-is/m-p/3269469#M121122</link>
    <description>&lt;P&gt;NewStep=let a=Table.Group(Table2,"City",{"n",each [Sister_Cities]}) in Table.TransformColumns(Table1,{"Cities",each Text.Combine({_}&amp;amp;List.TransformMany(Text.Split(_,","),each a{[City=_]}?[n]? ??{},(x,y)=&amp;gt;y),",")})&lt;/P&gt;</description>
    <pubDate>Tue, 06 Jun 2023 01:44:30 GMT</pubDate>
    <dc:creator>wdx223_Daniel</dc:creator>
    <dc:date>2023-06-06T01:44:30Z</dc:date>
    <item>
      <title>Table.SelectRows when one column concatenated and the other is split into rows</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Table-SelectRows-when-one-column-concatenated-and-the-other-is/m-p/3269352#M121111</link>
      <description>&lt;P&gt;I want to create a custom column using Table.SelectRows (or any other expression) that does the following. In my Table1, I have a column called Cities that lists values separated by a comma:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;TABLE border="1"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;&lt;STRONG&gt;Country&lt;/STRONG&gt;&lt;/TD&gt;&lt;TD&gt;&lt;STRONG&gt;Cities&lt;/STRONG&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;France&lt;/TD&gt;&lt;TD&gt;Paris, Lyon, Marseille&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;Germany&lt;/TD&gt;&lt;TD&gt;Berlin, Munich, Dortmund&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;In my Table2, I have a Sister_Cities column like this:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;TABLE border="1"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;&lt;STRONG&gt;City&lt;/STRONG&gt;&lt;/TD&gt;&lt;TD&gt;&lt;STRONG&gt;Sister_Cities&lt;/STRONG&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;Paris&lt;/TD&gt;&lt;TD&gt;Rome&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;Lyon&lt;/TD&gt;&lt;TD&gt;Birmingham&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;Lyon&lt;/TD&gt;&lt;TD&gt;Guangzhou&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;Lyon&lt;/TD&gt;&lt;TD&gt;Montreal&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;Lyon&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;Addis Ababa&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;Marseille&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;Genoa&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;Marseille&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;Glasgow&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I know the logical thing to do would be to split the first table into rows and then do a join based on the Cities and City columns, but I want to keep them concatenated so that I have a new column in Table1 that looks like this:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;TABLE border="1"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;&lt;STRONG&gt;Country&lt;/STRONG&gt;&lt;/TD&gt;&lt;TD&gt;&lt;STRONG&gt;Cities&lt;/STRONG&gt;&lt;/TD&gt;&lt;TD&gt;&lt;STRONG&gt;Custom.Sister_Cities&lt;/STRONG&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;France&lt;/TD&gt;&lt;TD&gt;Paris, Lyon, Marseille&lt;/TD&gt;&lt;TD&gt;Rome, Birmingham, Guangzhou, Montreal, Addis Ababa, Genoa, Glasgow&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;What's the best way to achieve this? Appreciate any advice!&lt;/P&gt;</description>
      <pubDate>Mon, 05 Jun 2023 21:57:27 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Table-SelectRows-when-one-column-concatenated-and-the-other-is/m-p/3269352#M121111</guid>
      <dc:creator>user180618</dc:creator>
      <dc:date>2023-06-05T21:57:27Z</dc:date>
    </item>
    <item>
      <title>Re: Table.SelectRows when one column concatenated and the other is split into rows</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Table-SelectRows-when-one-column-concatenated-and-the-other-is/m-p/3269469#M121122</link>
      <description>&lt;P&gt;NewStep=let a=Table.Group(Table2,"City",{"n",each [Sister_Cities]}) in Table.TransformColumns(Table1,{"Cities",each Text.Combine({_}&amp;amp;List.TransformMany(Text.Split(_,","),each a{[City=_]}?[n]? ??{},(x,y)=&amp;gt;y),",")})&lt;/P&gt;</description>
      <pubDate>Tue, 06 Jun 2023 01:44:30 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Table-SelectRows-when-one-column-concatenated-and-the-other-is/m-p/3269469#M121122</guid>
      <dc:creator>wdx223_Daniel</dc:creator>
      <dc:date>2023-06-06T01:44:30Z</dc:date>
    </item>
    <item>
      <title>Re: Table.SelectRows when one column concatenated and the other is split into rows</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Table-SelectRows-when-one-column-concatenated-and-the-other-is/m-p/3273297#M121392</link>
      <description>&lt;P&gt;This gives a &lt;EM&gt;"Expression.Error: A cyclic reference was encountered during evaluation"&lt;/EM&gt; error.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Here is the full code in Advanced Editor:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;let
    Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45WcitKzEtOVdJRCkgsyizWUfCpzM/TUfBNLCpOzczJSVWK1YlWck8tyk3MqwQqckotyskEyZfmZSZn6Ci45BeV5JbmpSjFxgIA", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [Country = _t, Cities = _t]),
    #"Changed Type" = Table.TransformColumnTypes(Source,{{"Country", type text}, {"Cities", type text}}),
    #"Added Custom" = Table.AddColumn(#"Changed Type", "NewStep", each let a=Table.Group(Table2,"City",{"n",each [Sister_Cities]}) in Table.TransformColumns(Table1,{"Cities",each Text.Combine({_}&amp;amp;List.TransformMany(Text.Split(_,","),each a{[City=_]}?[n]? ??{},(x,y)=&amp;gt;y),",")}))
in
    #"Added Custom"&lt;/LI-CODE&gt;</description>
      <pubDate>Wed, 07 Jun 2023 18:32:49 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Table-SelectRows-when-one-column-concatenated-and-the-other-is/m-p/3273297#M121392</guid>
      <dc:creator>user180618</dc:creator>
      <dc:date>2023-06-07T18:32:49Z</dc:date>
    </item>
  </channel>
</rss>

