<?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 Returning comma separated values from a filtered related table in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Returning-comma-separated-values-from-a-filtered-related-table/m-p/3994933#M155149</link>
    <description>&lt;P&gt;Hi&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm trying to create a measure similar to this:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;Selected Suppress Labels =
CONCATENATEX(
        VALUES(Main_Inc_CC_And_tfs_SurveyResults[Suppress Label (big 14 2022 - big 14 2024 only)]),
        Main_Inc_CC_And_tfs_SurveyResults[Suppress Label (big 14 2022 - big 14 2024 only)],
        ", ",
	    Main_Inc_CC_And_tfs_SurveyResults[Suppress Label (big 14 2022 - big 14 2024 only)],
	    ASC
        )&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This returns a comma separated list of the values in the&amp;nbsp;&lt;EM&gt;Suppress Label (big 14 2022 - big 14 2024 only) &lt;/EM&gt;field based on the current filter/slicer context of my report.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;However, to simplify my raw data, i'd like to create a measure to pull the 'Suppress Label' values from a field in a different table connected via a 'CN-Q code' in a one-to-many relationship:&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I've tried to adapt a measure i've used to previously to pull data from connecting tables (with a calculate function):&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;Pull values from ReturnsData_21_22_to_23_24_table =
    CALCULATE (
        CONCATENATEX(
        VALUES(ReturnsData_21_22_to_23_24[Suppress Label]),
        ReturnsData_21_22_to_23_24[Suppress Label],
        ", ",
	    ReturnsData_21_22_to_23_24[Suppress Label],
	    ASC
        ),
        FILTER (
            ReturnsData_21_22_to_23_24,
            ReturnsData_21_22_to_23_24[CN-Q code] == MAXX ( Main_Inc_CC_And_tfs_SurveyResults, Main_Inc_CC_And_tfs_SurveyResults[CN-Q code] )
        )
    )&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;but it seems to return only one value instead of a comma separated list when more than one are selected in the&amp;nbsp;&lt;EM&gt;Main_Inc_CC_And_tfs_SurveyResults[Suppress Label (big 14 2022 - big 14 2024 only)]&lt;/EM&gt;&amp;nbsp;field (and therefore the&amp;nbsp;&lt;EM&gt;ReturnsData_21_22_to_23_24[Suppress Label]&lt;/EM&gt;&amp;nbsp;field):&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;Apologies if this doesn't give enough information, i'll upload a .pbix file if necessary.&lt;BR /&gt;&lt;BR /&gt;Any help would be much appreciated&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;JFarq&lt;/P&gt;</description>
    <pubDate>Sun, 16 Jun 2024 18:06:26 GMT</pubDate>
    <dc:creator>JFarq</dc:creator>
    <dc:date>2024-06-16T18:06:26Z</dc:date>
    <item>
      <title>Returning comma separated values from a filtered related table</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Returning-comma-separated-values-from-a-filtered-related-table/m-p/3994933#M155149</link>
      <description>&lt;P&gt;Hi&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm trying to create a measure similar to this:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;Selected Suppress Labels =
CONCATENATEX(
        VALUES(Main_Inc_CC_And_tfs_SurveyResults[Suppress Label (big 14 2022 - big 14 2024 only)]),
        Main_Inc_CC_And_tfs_SurveyResults[Suppress Label (big 14 2022 - big 14 2024 only)],
        ", ",
	    Main_Inc_CC_And_tfs_SurveyResults[Suppress Label (big 14 2022 - big 14 2024 only)],
	    ASC
        )&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This returns a comma separated list of the values in the&amp;nbsp;&lt;EM&gt;Suppress Label (big 14 2022 - big 14 2024 only) &lt;/EM&gt;field based on the current filter/slicer context of my report.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;However, to simplify my raw data, i'd like to create a measure to pull the 'Suppress Label' values from a field in a different table connected via a 'CN-Q code' in a one-to-many relationship:&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I've tried to adapt a measure i've used to previously to pull data from connecting tables (with a calculate function):&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;Pull values from ReturnsData_21_22_to_23_24_table =
    CALCULATE (
        CONCATENATEX(
        VALUES(ReturnsData_21_22_to_23_24[Suppress Label]),
        ReturnsData_21_22_to_23_24[Suppress Label],
        ", ",
	    ReturnsData_21_22_to_23_24[Suppress Label],
	    ASC
        ),
        FILTER (
            ReturnsData_21_22_to_23_24,
            ReturnsData_21_22_to_23_24[CN-Q code] == MAXX ( Main_Inc_CC_And_tfs_SurveyResults, Main_Inc_CC_And_tfs_SurveyResults[CN-Q code] )
        )
    )&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;but it seems to return only one value instead of a comma separated list when more than one are selected in the&amp;nbsp;&lt;EM&gt;Main_Inc_CC_And_tfs_SurveyResults[Suppress Label (big 14 2022 - big 14 2024 only)]&lt;/EM&gt;&amp;nbsp;field (and therefore the&amp;nbsp;&lt;EM&gt;ReturnsData_21_22_to_23_24[Suppress Label]&lt;/EM&gt;&amp;nbsp;field):&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;Apologies if this doesn't give enough information, i'll upload a .pbix file if necessary.&lt;BR /&gt;&lt;BR /&gt;Any help would be much appreciated&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;JFarq&lt;/P&gt;</description>
      <pubDate>Sun, 16 Jun 2024 18:06:26 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Returning-comma-separated-values-from-a-filtered-related-table/m-p/3994933#M155149</guid>
      <dc:creator>JFarq</dc:creator>
      <dc:date>2024-06-16T18:06:26Z</dc:date>
    </item>
    <item>
      <title>Re: Returning comma separated values from a filtered related table</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Returning-comma-separated-values-from-a-filtered-related-table/m-p/3994968#M155155</link>
      <description>&lt;P&gt;Hello&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="472263" data-lia-user-login="JFarq" class="lia-mention lia-mention-user"&gt;JFarq&lt;/a&gt;&amp;nbsp;,&amp;nbsp;&lt;BR /&gt;Can you please upload a PBIX file to investigate the issue?&lt;BR /&gt;&lt;BR /&gt;Thank you.&lt;/P&gt;</description>
      <pubDate>Sun, 16 Jun 2024 22:51:43 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Returning-comma-separated-values-from-a-filtered-related-table/m-p/3994968#M155155</guid>
      <dc:creator>Moetazzahran</dc:creator>
      <dc:date>2024-06-16T22:51:43Z</dc:date>
    </item>
    <item>
      <title>Re: Returning comma separated values from a filtered related table</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Returning-comma-separated-values-from-a-filtered-related-table/m-p/3997307#M155435</link>
      <description>&lt;P&gt;Hi,&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="472263" data-lia-user-login="JFarq" class="lia-mention lia-mention-user"&gt;JFarq&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Maybe you can create measures and try the following DAX expression:&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;Unique Suppress Labels = 
    CONCATENATEX (
        DISTINCT ( 'Table'[Suppress Label] ),
        'Table'[Suppress Label],
        ", "
    )

Filtered Suppress Labels = 
    CALCULATE (
        [Unique Suppress Labels],
        FILTER (
            'Table',
            'Table'[CN-Q code] = MAXX ( 'Table', 'Table'[CN-Q code] )
        )
    )
&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Here is my preview:&lt;/P&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;If it does not help, please provide more details with your desired output and pbix file without privacy information (or some sample data)&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P style="margin: 6.0pt 0cm 0cm 0cm;"&gt;&lt;SPAN&gt;&lt;A title="https://community.powerbi.com/t5/community-blog/how-to-get-your-question-answered-quickly/ba-p/38490" href="https://nam06.safelinks.protection.outlook.com/?url=https%3A%2F%2Fcommunity.powerbi.com%2Ft5%2FCommunity-Blog%2FHow-to-Get-Your-Question-Answered-Quickly%2Fba-p%2F38490&amp;amp;data=05%7C02%7Cv-yohua%40microsoft.com%7Ce1106bfabecb4734a5cc08dc2305bc51%7C72f988bf86f141af91ab2d7cd011db47%7C1%7C0%7C638423754744679080%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C0%7C%7C%7C&amp;amp;sdata=24%2BceC5sFd3n3%2FhFDYILWFcNjCwVClBD%2BPBsSLVfJGk%3D&amp;amp;reserved=0" target="_blank" rel="noopener"&gt;How to Get Your Question Answered Quickly&lt;/A&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="margin-bottom: 6.0pt;"&gt;&lt;SPAN&gt;Best Regards&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="margin-bottom: 6.0pt;"&gt;&lt;SPAN&gt;Yongkang Hua&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="margin-bottom: 6.0pt;"&gt;&lt;SPAN&gt;If this post &lt;STRONG&gt;helps&lt;/STRONG&gt;, then please consider &lt;STRONG&gt;Accept it as the solution&lt;/STRONG&gt; to help the other members find it more quickly.&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 18 Jun 2024 03:20:10 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Returning-comma-separated-values-from-a-filtered-related-table/m-p/3997307#M155435</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2024-06-18T03:20:10Z</dc:date>
    </item>
  </channel>
</rss>

