<?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: Common Items in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Common-Items/m-p/2006304#M44595</link>
    <description>&lt;P&gt;Hi &lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="250150" data-lia-user-login="CNENFRNL" class="lia-mention lia-mention-user"&gt;CNENFRNL&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks for your assistance. Your solution works...&lt;/P&gt;&lt;P&gt;However I currently have over 3100 items for sale in the table so unfortunatly it creates a massive table that bombs out on my laptop wants it reaches about 86million rows.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm not too farmilar with PQ, but I was thinking perhaps we could add a conditional formula in, something like only list the items purchased over 3 times together?&lt;/P&gt;&lt;P&gt;Currently the Sales Table just contains a list of items bought by date, so we could summarize the Sales table by count of unique items and then apply a filter for only items bought more than 3 times and then apply your suggestion above?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Would that be possible?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks in advance&lt;/P&gt;</description>
    <pubDate>Mon, 09 Aug 2021 16:12:54 GMT</pubDate>
    <dc:creator>SammyNed</dc:creator>
    <dc:date>2021-08-09T16:12:54Z</dc:date>
    <item>
      <title>Common Items</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Common-Items/m-p/2002442#M44459</link>
      <description>&lt;P&gt;Hi guys,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Can someone please assist?&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have a table of data, (a simplified view is below), but basically we sell products.&lt;/P&gt;&lt;P&gt;There are 3 columns:&lt;/P&gt;&lt;P&gt;Order ID (unique per order)&lt;/P&gt;&lt;P&gt;Item_Name (items that can be added in an order)&lt;/P&gt;&lt;P&gt;Item_Qty (number of item_names that can be added in an order)&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I want to know which items are frequently bought together , can use this info to perhaps have combo deals. A sample of my outcome is shown below:&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Please assist...&lt;/P&gt;&lt;P&gt;Thanks in advance&lt;/P&gt;</description>
      <pubDate>Fri, 06 Aug 2021 12:55:06 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Common-Items/m-p/2002442#M44459</guid>
      <dc:creator>SammyNed</dc:creator>
      <dc:date>2021-08-06T12:55:06Z</dc:date>
    </item>
    <item>
      <title>Re: Common Items</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Common-Items/m-p/2002533#M44465</link>
      <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="312920" data-lia-user-login="SammyNed" class="lia-mention lia-mention-user"&gt;SammyNed&lt;/a&gt;&amp;nbsp;Here is one method:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;Table 2 = 
    VAR __Table = GENERATE(SELECTCOLUMNS(DISTINCT('Table2'[Item_Name]),"Item_Name_1",[Item_Name]),SELECTCOLUMNS(DISTINCT('Table2'[Item_Name]),"Item_Name_2",[Item_Name]))
    VAR __Table1 = SELECTCOLUMNS(SUMMARIZE('Table2','Table2'[Order_ID],"__Items",CONCATENATEX('Table2',[Item_Name],",")),"__Items",[__Items])
    VAR __Table2 = 
        ADDCOLUMNS(
            __Table,
            "__var",
            VAR __t1 = SUMMARIZE(FILTER('Table2',[Item_Name] = [Item_Name_1] || [Item_Name] = [Item_Name_2]),[Order_ID],"__Count",COUNTROWS('Table2'))
            RETURN
            COUNTROWS(FILTER(__t1,[__Count]&amp;gt;1))
        )
RETURN
    __Table2&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;In this example, 'Table2' is the source data table you presented.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 06 Aug 2021 13:51:13 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Common-Items/m-p/2002533#M44465</guid>
      <dc:creator>Greg_Deckler</dc:creator>
      <dc:date>2021-08-06T13:51:13Z</dc:date>
    </item>
    <item>
      <title>Re: Common Items</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Common-Items/m-p/2002549#M44467</link>
      <description>&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;STRONG&gt;&lt;EM&gt;Orders Count Basket : = &lt;/EM&gt;&lt;/STRONG&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;EM&gt;VAR _itemoneorders =&lt;/EM&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;EM&gt;VALUES ( Sales[Order_ID] )&lt;/EM&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;EM&gt;VAR _itemtwoorders =&lt;/EM&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;EM&gt;CALCULATETABLE (&lt;/EM&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;EM&gt;VALUES ( Sales[Order_ID] ),&lt;/EM&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;EM&gt;ALL ( 'Item One' ),&lt;/EM&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;EM&gt;TREATAS ( VALUES ( 'Item Two'[Item_Name_2] ), Sales[Item_Name] )&lt;/EM&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;EM&gt;)&lt;/EM&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;EM&gt;VAR _newtable =&lt;/EM&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;EM&gt;INTERSECT ( _itemoneorders, _itemtwoorders )&lt;/EM&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;EM&gt;RETURN&lt;/EM&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;EM&gt;IF (&lt;/EM&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;EM&gt;HASONEVALUE ( 'Item One'[Item_Name_1] )&lt;/EM&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;EM&gt;&amp;amp;&amp;amp; HASONEVALUE ( 'Item Two'[Item_Name_2] ),&lt;/EM&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;EM&gt;IF (&lt;/EM&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;EM&gt;SELECTEDVALUE ( 'Item One'[Item_Name_1] )&lt;/EM&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;EM&gt;&amp;lt;&amp;gt; SELECTEDVALUE ( 'Item Two'[Item_Name_2] ),&lt;/EM&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;EM&gt;COUNTROWS ( _newtable )&lt;/EM&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;EM&gt;)&lt;/EM&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;EM&gt;)&lt;/EM&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&lt;A href="https://www.dropbox.com/s/9xeibbmbig7ejv9/sammyned.pbix?dl=0" target="_self"&gt;Link to the sample pbix file&lt;/A&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;/DIV&gt;</description>
      <pubDate>Fri, 06 Aug 2021 13:56:22 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Common-Items/m-p/2002549#M44467</guid>
      <dc:creator>Jihwan_Kim</dc:creator>
      <dc:date>2021-08-06T13:56:22Z</dc:date>
    </item>
    <item>
      <title>Re: Common Items</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Common-Items/m-p/2002564#M44468</link>
      <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="312920" data-lia-user-login="SammyNed" class="lia-mention lia-mention-user"&gt;SammyNed&lt;/a&gt;&amp;nbsp;Here is a cleaned up version:&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;Table 2 = 
    VAR __Table = 
        DISTINCT(
            FILTER(
                GENERATE(
                    SELECTCOLUMNS(DISTINCT('Table'[Item_Name]),"Item_Name_1",[Item_Name]),
                    SELECTCOLUMNS(DISTINCT('Table'[Item_Name]),"Item_Name_2",[Item_Name])
                ),
                [Item_Name_1]&amp;lt;&amp;gt;[Item_Name_2])
            )
    VAR __Table2 = 
        ADDCOLUMNS(
            __Table,
            "__var",
            VAR __t1 = SUMMARIZE(FILTER('Table',[Item_Name] = [Item_Name_1] || [Item_Name] = [Item_Name_2]),[Order_ID],"__Count",COUNTROWS('Table'))
            RETURN
            COUNTROWS(FILTER(__t1,[__Count]&amp;gt;1))+0
        )
RETURN
    __Table2&lt;/LI-CODE&gt;</description>
      <pubDate>Fri, 06 Aug 2021 14:01:44 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Common-Items/m-p/2002564#M44468</guid>
      <dc:creator>Greg_Deckler</dc:creator>
      <dc:date>2021-08-06T14:01:44Z</dc:date>
    </item>
    <item>
      <title>Re: Common Items</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Common-Items/m-p/2003042#M44488</link>
      <description>&lt;P&gt;PBI = PQ + DAX. Make the best of PQ; a mere transformation makes it way much easier,&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;let
    Source = List.Distinct(SALES[Item_Name]),
    Combination = Table.FromRows(List.TransformMany(Source, each List.Skip(Source, List.PositionOf(Source, _)+1), (x,y) =&amp;gt; {x,y}), {"Item1","Item2"})
in
    Combination&lt;/LI-CODE&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 06 Aug 2021 19:54:48 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Common-Items/m-p/2003042#M44488</guid>
      <dc:creator>CNENFRNL</dc:creator>
      <dc:date>2021-08-06T19:54:48Z</dc:date>
    </item>
    <item>
      <title>Re: Common Items</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Common-Items/m-p/2006304#M44595</link>
      <description>&lt;P&gt;Hi &lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="250150" data-lia-user-login="CNENFRNL" class="lia-mention lia-mention-user"&gt;CNENFRNL&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks for your assistance. Your solution works...&lt;/P&gt;&lt;P&gt;However I currently have over 3100 items for sale in the table so unfortunatly it creates a massive table that bombs out on my laptop wants it reaches about 86million rows.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm not too farmilar with PQ, but I was thinking perhaps we could add a conditional formula in, something like only list the items purchased over 3 times together?&lt;/P&gt;&lt;P&gt;Currently the Sales Table just contains a list of items bought by date, so we could summarize the Sales table by count of unique items and then apply a filter for only items bought more than 3 times and then apply your suggestion above?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Would that be possible?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks in advance&lt;/P&gt;</description>
      <pubDate>Mon, 09 Aug 2021 16:12:54 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Common-Items/m-p/2006304#M44595</guid>
      <dc:creator>SammyNed</dc:creator>
      <dc:date>2021-08-09T16:12:54Z</dc:date>
    </item>
    <item>
      <title>Re: Common Items</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Common-Items/m-p/2006312#M44596</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="313" data-lia-user-login="Greg_Deckler" class="lia-mention lia-mention-user"&gt;Greg_Deckler&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks foryour assistance.&lt;/P&gt;&lt;P&gt;However i currently have over 3100 items in the table and my laptop bombs out as 3100 factorial is undefined.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 09 Aug 2021 16:15:44 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Common-Items/m-p/2006312#M44596</guid>
      <dc:creator>SammyNed</dc:creator>
      <dc:date>2021-08-09T16:15:44Z</dc:date>
    </item>
    <item>
      <title>Re: Common Items</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Common-Items/m-p/2006464#M44600</link>
      <description />
      <pubDate>Mon, 09 Aug 2021 18:39:31 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Common-Items/m-p/2006464#M44600</guid>
      <dc:creator>CNENFRNL</dc:creator>
      <dc:date>2021-08-09T18:39:31Z</dc:date>
    </item>
  </channel>
</rss>

