<?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: Comma Separated List in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Comma-Separated-List/m-p/2930313#M96383</link>
    <description>&lt;P&gt;Thank you.&lt;/P&gt;&lt;P&gt;However, how do I create the actual table and not only get the scalar value please?&lt;/P&gt;</description>
    <pubDate>Sat, 26 Nov 2022 00:18:24 GMT</pubDate>
    <dc:creator>Asking</dc:creator>
    <dc:date>2022-11-26T00:18:24Z</dc:date>
    <item>
      <title>Comma Separated List</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Comma-Separated-List/m-p/2930146#M96373</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have 1 table with the first column as ID:&lt;/P&gt;&lt;P&gt;1 X Y&lt;/P&gt;&lt;P&gt;1 X1 Y&lt;/P&gt;&lt;P&gt;2 X Z&lt;/P&gt;&lt;P&gt;2 X1 Z&lt;/P&gt;&lt;P&gt;3 X2 Z&lt;/P&gt;&lt;P&gt;1 X4 F&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;After this table is filterd by a slicer on the report, Let's say Y and Z from 3rd column are chosen, I want to create a count of all the possible combinations from the second column. In this case:&lt;/P&gt;&lt;P&gt;Combination Count&lt;/P&gt;&lt;P&gt;X,X1&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;2 (there are 2 ID's with X,X1)&lt;/P&gt;&lt;P&gt;X2&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 1 (there is 1 ID with X2)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Is that possible please?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 25 Nov 2022 19:16:46 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Comma-Separated-List/m-p/2930146#M96373</guid>
      <dc:creator>Asking</dc:creator>
      <dc:date>2022-11-25T19:16:46Z</dc:date>
    </item>
    <item>
      <title>Re: Comma Separated List</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Comma-Separated-List/m-p/2930235#M96377</link>
      <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="456818" data-lia-user-login="Asking" class="lia-mention lia-mention-user"&gt;Asking&lt;/a&gt;&amp;nbsp;Try this:&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;Measure = 
    VAR __Table = ADDCOLUMNS(SUMMARIZE('Table',[Column3]),"__Text",CONCATENATEX('Table',[Column2],","))
    VAR __Values = DISTINCT(SELECTCOLUMNS(__Table,"__Text",[__Text]))
    VAR __Table1 = ADDCOLUMNS(SUMMARIZE('Table',[Column1]),"__Text",CONCATENATEX('Table',[Column2],","))
    VAR __Table2 = FILTER(__Table1,[__Text] IN __Values)
    VAR __Result = COUNTROWS(DISTINCT(SELECTCOLUMNS(__Table2,"__Index",[Column1])))
RETURN
    __Result&lt;/LI-CODE&gt;</description>
      <pubDate>Fri, 25 Nov 2022 21:57:44 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Comma-Separated-List/m-p/2930235#M96377</guid>
      <dc:creator>Greg_Deckler</dc:creator>
      <dc:date>2022-11-25T21:57:44Z</dc:date>
    </item>
    <item>
      <title>Re: Comma Separated List</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Comma-Separated-List/m-p/2930313#M96383</link>
      <description>&lt;P&gt;Thank you.&lt;/P&gt;&lt;P&gt;However, how do I create the actual table and not only get the scalar value please?&lt;/P&gt;</description>
      <pubDate>Sat, 26 Nov 2022 00:18:24 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Comma-Separated-List/m-p/2930313#M96383</guid>
      <dc:creator>Asking</dc:creator>
      <dc:date>2022-11-26T00:18:24Z</dc:date>
    </item>
    <item>
      <title>Re: Comma Separated List</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Comma-Separated-List/m-p/2931205#M96426</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="456818" data-lia-user-login="Asking" class="lia-mention lia-mention-user"&gt;Asking&lt;/a&gt;&amp;nbsp;&lt;BR /&gt;This not as simple as it sounds. The reason is that there is no column to slice by. Long story short, please refer to attched file and following screenshots. You have to have either index or Date column. If don't, then use power query to add an index column. Please let me know if you need any further help.&lt;/P&gt;
&lt;P&gt;&lt;img /&gt;&lt;img /&gt;&lt;img /&gt;&lt;img /&gt;&lt;/P&gt;
&lt;LI-CODE lang="javascript"&gt;Combination = 
VAR T1 =
    SUMMARIZE (
        'Table',
        'Table'[Column1],
        "@Index", MAX ( 'Table'[Index] ),
        "@Combination", CONCATENATEX ( 'Table', 'Table'[Column2], "," )
    )
VAR T2 =
    SUMMARIZE ( 
        T1, 
        [@Combination],
        "@@Index", MAX ( 'Table'[Index] )
    )
VAR T3 =
    ADDCOLUMNS ( 
        T2,
        "@Rank", RANKX ( T2, [@@Index],, ASC, Dense ) 
    )
RETURN
    MAXX ( 
        FILTER ( T3, [@Rank] = SELECTEDVALUE ( 'Table 2'[Value] ) ),
        [@Combination]
    )&lt;/LI-CODE&gt;&lt;LI-CODE lang="javascript"&gt;Count = 
VAR T1 =
    SUMMARIZE (
        'Table',
        'Table'[Column1],
        "@Index", MAX ( 'Table'[Index] ),
        "@Combination", CONCATENATEX ( 'Table', 'Table'[Column2], "," )
    )
VAR T2 =
    SUMMARIZE ( 
        T1, 
        [@Combination],
        "@@Index", MAX ( 'Table'[Index] ),
        "@Count", COUNTROWS ( FILTER ( T1, [@Combination] = EARLIER ( [@Combination] ) ) )
    )
VAR T3 =
    ADDCOLUMNS ( 
        T2,
        "@Rank", RANKX ( T2, [@@Index],, ASC, Dense ) 
    )
RETURN
    MAXX ( 
        FILTER ( T3, [@Rank] = SELECTEDVALUE ( 'Table 2'[Value] ) ),
        [@Count]
    )&lt;/LI-CODE&gt;</description>
      <pubDate>Sun, 27 Nov 2022 15:02:21 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Comma-Separated-List/m-p/2931205#M96426</guid>
      <dc:creator>tamerj1</dc:creator>
      <dc:date>2022-11-27T15:02:21Z</dc:date>
    </item>
    <item>
      <title>Re: Comma Separated List</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Comma-Separated-List/m-p/2933961#M96609</link>
      <description>&lt;P&gt;Thank you. That helped.&lt;/P&gt;&lt;P&gt;Is there a way I can show the result as a stacked bar chart. I would like the "combination" to be in the Y axis and the "count" in the X but I understand I can't put a measure in the Y...&lt;/P&gt;</description>
      <pubDate>Mon, 28 Nov 2022 21:46:42 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Comma-Separated-List/m-p/2933961#M96609</guid>
      <dc:creator>Asking</dc:creator>
      <dc:date>2022-11-28T21:46:42Z</dc:date>
    </item>
    <item>
      <title>Re: Comma Separated List</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Comma-Separated-List/m-p/2934457#M96632</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="456818" data-lia-user-login="Asking" class="lia-mention lia-mention-user"&gt;Asking&lt;/a&gt;&amp;nbsp;&lt;BR /&gt;I hope this is what you're looking for. Please refer to attached updated sample file.&lt;/P&gt;
&lt;P&gt;&lt;img /&gt;&lt;img /&gt;&lt;/P&gt;
&lt;LI-CODE lang="javascript"&gt;Combinations = 
SELECTCOLUMNS (
    SUMMARIZE (
        'Table',
        'Table'[Column1],
        "@Combination", CONCATENATEX ( 'Table', 'Table'[Column2], "," )
    ),
    "Combination", 
    [@Combination]
)&lt;/LI-CODE&gt;&lt;LI-CODE lang="javascript"&gt;Count2 = 
VAR T1 =
    SUMMARIZE (
        'Table',
        'Table'[Column1],
        "@Combination", CONCATENATEX ( 'Table', 'Table'[Column2], "," )
    )
VAR T2 =
    SUMMARIZE ( 
        T1, 
        [@Combination],
        "@Count", COUNTROWS ( FILTER ( T1, [@Combination] = EARLIER ( [@Combination] ) ) )
    )
RETURN
    MAXX ( 
        FILTER ( T2, [@Combination] = SELECTEDVALUE ( Combinations[Combination] ) ),
        [@Count]
    )&lt;/LI-CODE&gt;</description>
      <pubDate>Tue, 29 Nov 2022 04:30:45 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Comma-Separated-List/m-p/2934457#M96632</guid>
      <dc:creator>tamerj1</dc:creator>
      <dc:date>2022-11-29T04:30:45Z</dc:date>
    </item>
  </channel>
</rss>

