<?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: Comparing column values and ignoring the order of element DAX in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Comparing-column-values-and-ignoring-the-order-of-element-DAX/m-p/2047641#M46008</link>
    <description>&lt;LI-CODE lang="cpp"&gt;Output = 
VAR _tbl =
    ADDCOLUMNS (
        ALL ( SampleTable[Combo Code] ),
        "@new",
            VAR _p =
                SUBSTITUTE ( 'SampleTable'[Combo Code], ",", "|" )
            VAR _len =
                PATHLENGTH ( _p )
            VAR _series =
                GENERATESERIES ( 1, _len )
            VAR _items =
                ADDCOLUMNS ( _series, "@item", PATHITEM ( _p, [Value] ) )
            VAR _items_with_idx =
                ADDCOLUMNS (
                    _items,
                    "@idx", COUNTROWS ( FILTER ( _items, [@item] &amp;lt;= EARLIER ( [@item] ) ) )
                )
            RETURN
                CONCATENATEX (
                    _series,
                    MAXX (
                        TOPN (
                            1,
                            FILTER ( _items_with_idx, [@idx] &amp;gt;= EARLIER ( [Value] ) ),
                            [@idx], ASC
                        ),
                        [@item]
                    ),
                    ","
                )
    )
RETURN
    MINX (
        FILTER (
            _tbl,
            'SampleTable'[Combo Code] = SELECTEDVALUE ( SampleTable[Combo Code] )
        ),
        [@new]
    )&lt;/LI-CODE&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Tue, 31 Aug 2021 03:48:09 GMT</pubDate>
    <dc:creator>wdx223_Daniel</dc:creator>
    <dc:date>2021-08-31T03:48:09Z</dc:date>
    <item>
      <title>Comparing column values and ignoring the order of element DAX</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Comparing-column-values-and-ignoring-the-order-of-element-DAX/m-p/2046594#M45987</link>
      <description>&lt;P&gt;Hi All,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have a column where I need to check whether the column value contains the same data in any order.&lt;BR /&gt;I want to get the first value as output value if the value matches in any order.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Can we do this using DAX ??&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Example.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;TABLE&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;Combo code&lt;/TD&gt;&lt;TD&gt;Output&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;1059-0,1056-1&lt;/TD&gt;&lt;TD&gt;1059-0,1056-1&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;1056-1,1059-0&lt;/TD&gt;&lt;TD&gt;1059-0,1056-1&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;312-0,313-1,314-2&lt;/TD&gt;&lt;TD&gt;312-0,313-1,314-2&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;314-2,313-1,312-0&lt;/TD&gt;&lt;TD&gt;312-0,313-1,314-2&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;</description>
      <pubDate>Mon, 30 Aug 2021 15:34:51 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Comparing-column-values-and-ignoring-the-order-of-element-DAX/m-p/2046594#M45987</guid>
      <dc:creator>Sharma0815</dc:creator>
      <dc:date>2021-08-30T15:34:51Z</dc:date>
    </item>
    <item>
      <title>Re: Comparing column values and ignoring the order of element DAX</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Comparing-column-values-and-ignoring-the-order-of-element-DAX/m-p/2047641#M46008</link>
      <description>&lt;LI-CODE lang="cpp"&gt;Output = 
VAR _tbl =
    ADDCOLUMNS (
        ALL ( SampleTable[Combo Code] ),
        "@new",
            VAR _p =
                SUBSTITUTE ( 'SampleTable'[Combo Code], ",", "|" )
            VAR _len =
                PATHLENGTH ( _p )
            VAR _series =
                GENERATESERIES ( 1, _len )
            VAR _items =
                ADDCOLUMNS ( _series, "@item", PATHITEM ( _p, [Value] ) )
            VAR _items_with_idx =
                ADDCOLUMNS (
                    _items,
                    "@idx", COUNTROWS ( FILTER ( _items, [@item] &amp;lt;= EARLIER ( [@item] ) ) )
                )
            RETURN
                CONCATENATEX (
                    _series,
                    MAXX (
                        TOPN (
                            1,
                            FILTER ( _items_with_idx, [@idx] &amp;gt;= EARLIER ( [Value] ) ),
                            [@idx], ASC
                        ),
                        [@item]
                    ),
                    ","
                )
    )
RETURN
    MINX (
        FILTER (
            _tbl,
            'SampleTable'[Combo Code] = SELECTEDVALUE ( SampleTable[Combo Code] )
        ),
        [@new]
    )&lt;/LI-CODE&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 31 Aug 2021 03:48:09 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Comparing-column-values-and-ignoring-the-order-of-element-DAX/m-p/2047641#M46008</guid>
      <dc:creator>wdx223_Daniel</dc:creator>
      <dc:date>2021-08-31T03:48:09Z</dc:date>
    </item>
    <item>
      <title>Re: Comparing column values and ignoring the order of element DAX</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Comparing-column-values-and-ignoring-the-order-of-element-DAX/m-p/2049635#M46073</link>
      <description>&lt;P&gt;Yes, DAX does the trick easily with some simple transformation of original dataset,&lt;/P&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;As to me, PQ solution is more straightforward and comprehensible.&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;let
    Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45WMjQwtdQ10AFSZrqGSrE6YBEgUwciAROBMY0NjYCqjQ2NgSqMDU10jTC0OELVAeXg6oyQdAP5RoYgfiwA", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [#"Combo code" = _t]),
    #"Added Custom" = Table.AddColumn(Source, "Codes", each Text.Combine(List.Sort(Text.Split([Combo code], ",")),",")),
    #"Grouped Rows" = Table.Group(#"Added Custom", {"Codes"}, {{"ar", each _, type table [Combo code=nullable text, Codes=text]}}),
    #"Expanded ar" = Table.ExpandTableColumn(#"Grouped Rows", "ar", {"Combo code"}, {"Combo code"})
in
    #"Expanded ar"&lt;/LI-CODE&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 31 Aug 2021 18:50:58 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Comparing-column-values-and-ignoring-the-order-of-element-DAX/m-p/2049635#M46073</guid>
      <dc:creator>CNENFRNL</dc:creator>
      <dc:date>2021-08-31T18:50:58Z</dc:date>
    </item>
  </channel>
</rss>

