<?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: Filter a table based on concatenated values in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Filter-a-table-based-on-concatenated-values/m-p/2083111#M47281</link>
    <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="270902" data-lia-user-login="DIACHROMA" class="lia-mention lia-mention-user"&gt;DIACHROMA&lt;/a&gt;&amp;nbsp;OK, let's go this route then:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;Measure =
  VAR __ProductsToSearchFor = SELECTCOLUMNS('dimProduct',"__ProductName",[ProductName])
  // this gets the products selected in the slicer in a table with just ProductName column
  VAR __Table =
    ADDCOLUMNS(
      __ProductsToSearchFor,
      "__Refs",
        VAR __String = [ProductName]
        VAR __Refs = 
          CONCATENATEX(
            SELECTCOLUMNS(
              FILTER('ProductsOfferedTable',CONTAINSSTRING([PRODUCT OFFERED],__String)),
              "__Ref",[REF]
            ),
            [__Ref],"|"
          )
      RETURN
        [__Refs]
    )
  VAR __AllRefs = CONCATENATEX(__Table,[__Refs],"|")
  VAR __Count = COUNTROWS(__AllRefs)
  VAR __AllRefsTable = 
    ADDCOLUMNS(
      GENERATESERIES(1,__Count,1),
      "__Ref",PATHITEM(__AllRefs,[Value],TEXT)
    )
RETURN
  COUNTROWS(DISTINCT(SELECTCOLUMNS(__AllRefsTable,"__Ref",[__Ref])))&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Fri, 17 Sep 2021 15:55:35 GMT</pubDate>
    <dc:creator>Greg_Deckler</dc:creator>
    <dc:date>2021-09-17T15:55:35Z</dc:date>
    <item>
      <title>Filter a table based on concatenated values</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Filter-a-table-based-on-concatenated-values/m-p/2081043#M47210</link>
      <description>&lt;P&gt;Hi guys,&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am working with a table in which the products are concatenated in the same column instead of having one row per product row :&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;TABLE&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;&lt;STRONG&gt;REF&lt;/STRONG&gt;&lt;/TD&gt;&lt;TD&gt;&lt;STRONG&gt;PRODUCT OFFERED&lt;/STRONG&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;001&lt;/TD&gt;&lt;TD&gt;AAA BBB DDD&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;002&lt;/TD&gt;&lt;TD&gt;CCC BBB&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;003&lt;/TD&gt;&lt;TD&gt;AAA&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;004&lt;/TD&gt;&lt;TD&gt;CCC DDD&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;005&lt;/TD&gt;&lt;TD&gt;BBB AAA&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;To give you a bit of context, my fact table is a list of sales visits where sales reps can offer multiple products. When the salesperson enters their report, they can check off as many products as they want. All these products arrive in one and the same column.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Besides, I have a Product&amp;nbsp;dim table :&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;TABLE&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;&lt;STRONG&gt;ProductName&lt;/STRONG&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;AAA&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;BBB&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;CCC&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;DDD&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I cannot create a relationship between the "Product" and "Offered Product" columns and I do not have access to the data (which is managed by the IT).&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;However, I absolutely need to know the number of times this or that product has been offered during the visits.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;So I created the below DAX measure :&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#333399"&gt;FoundProduct =&lt;/FONT&gt;&lt;/P&gt;&lt;P class="lia-indent-padding-left-30px"&gt;&lt;FONT color="#333399"&gt;VAR SearchValue = SEARCH( SELECTEDVALUE( ProductName ) ; SELECTEDVALUE( ProductOffered ) ; ; BLANK() )&lt;/FONT&gt;&lt;/P&gt;&lt;P class="lia-indent-padding-left-30px"&gt;&amp;nbsp;&lt;/P&gt;&lt;P class="lia-indent-padding-left-30px"&gt;&lt;FONT color="#333399"&gt;RETURN&lt;/FONT&gt;&lt;/P&gt;&lt;P class="lia-indent-padding-left-30px"&gt;&lt;FONT color="#333399"&gt;IF( SearchValue &amp;gt; 0 ; "Found" )&lt;/FONT&gt;&lt;/P&gt;&lt;P class="lia-indent-padding-left-30px"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#000000"&gt;And then, when adding the "FoundProduct" measure in the filter section of a visual&amp;nbsp;i was hoping it works. &lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#000000"&gt;However, I have several problems: sometimes the results are completely incorrect and above all, when I select several products, I have completely inconsistent results.&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#000000"&gt;How can I use my product table in a slicer to filter my visits table, while keeping the possibility of selecting several products?&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I can't wait to read your feedback!&lt;/P&gt;&lt;P&gt;A big thank you in advance,&lt;BR /&gt;Pauline&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 16 Sep 2021 18:46:20 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Filter-a-table-based-on-concatenated-values/m-p/2081043#M47210</guid>
      <dc:creator>DIACHROMA</dc:creator>
      <dc:date>2021-09-16T18:46:20Z</dc:date>
    </item>
    <item>
      <title>Re: Filter a table based on concatenated values</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Filter-a-table-based-on-concatenated-values/m-p/2081259#M47223</link>
      <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="270902" data-lia-user-login="DIACHROMA" class="lia-mention lia-mention-user"&gt;DIACHROMA&lt;/a&gt;&amp;nbsp;Well, I would recommend that you split that column in Power Query using space as delimiter, select your REF column and unpivot other columns. That would likely make this tremendously easier. If for some reason you cannot do that try&amp;nbsp;Count of List items:&amp;nbsp;&lt;A href="https://community.powerbi.com/t5/Quick-Measures-Gallery/Count-of-List-Items/m-p/350084#M98" target="_blank" rel="noopener"&gt;Count of List Items - Microsoft Power BI Community&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;In your case:&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;Measure =
  VAR __String = MAX('dimProduct'[ProductName])
  VAR __Strings = CONCATENATEX('Table',[PRODUCT OFFERED],", ")
  VAR __Length = LEN(__String)
RETURN
  ( LEN(__Strings) - LEN(SUBSTITUTE(__Strings,__String,"")) ) / __Length&lt;/LI-CODE&gt;
&lt;P&gt;If you put your ProductName in a table along with this measure, should work.&lt;/P&gt;</description>
      <pubDate>Thu, 16 Sep 2021 22:12:57 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Filter-a-table-based-on-concatenated-values/m-p/2081259#M47223</guid>
      <dc:creator>Greg_Deckler</dc:creator>
      <dc:date>2021-09-16T22:12:57Z</dc:date>
    </item>
    <item>
      <title>Re: Filter a table based on concatenated values</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Filter-a-table-based-on-concatenated-values/m-p/2082884#M47265</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;,&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you very much for your reply &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I created this formula, I have a result but it does not work when I select several products. At this point the data becomes inconsistent. Maybe it's because the products are not concatenated in the same order each time? Or maybe it comes from my model, I don't know ...&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;And when I don't select any product, the result shows 0 (and not the total as usual).&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;While waiting to find a solution I added the visual "Text Filter" from the market place. It works when I type in the name of a product, the numbers look ok but unfortunately I cannot enter multiple products in the search bar.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;So I am still working on finding a better solution...&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Pauline&lt;/P&gt;</description>
      <pubDate>Fri, 17 Sep 2021 14:14:47 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Filter-a-table-based-on-concatenated-values/m-p/2082884#M47265</guid>
      <dc:creator>DIACHROMA</dc:creator>
      <dc:date>2021-09-17T14:14:47Z</dc:date>
    </item>
    <item>
      <title>Re: Filter a table based on concatenated values</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Filter-a-table-based-on-concatenated-values/m-p/2082921#M47267</link>
      <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="270902" data-lia-user-login="DIACHROMA" class="lia-mention lia-mention-user"&gt;DIACHROMA&lt;/a&gt;&amp;nbsp;The formula is intended to work in conjunction with the ProductName from the Products table being in a table visualization along with the measure. You could use a slicer to limit which products are in the table visual. I will think about how this might be done without that, pretty sure I could create a solution around that.&lt;/P&gt;</description>
      <pubDate>Fri, 17 Sep 2021 14:28:01 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Filter-a-table-based-on-concatenated-values/m-p/2082921#M47267</guid>
      <dc:creator>Greg_Deckler</dc:creator>
      <dc:date>2021-09-17T14:28:01Z</dc:date>
    </item>
    <item>
      <title>Re: Filter a table based on concatenated values</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Filter-a-table-based-on-concatenated-values/m-p/2082928#M47268</link>
      <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="270902" data-lia-user-login="DIACHROMA" class="lia-mention lia-mention-user"&gt;DIACHROMA&lt;/a&gt;&amp;nbsp;OK, let's say you just want a total number of times things have been sold with only a slicer and let's say a Card visual to display the result. Try this:&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;Measure =
  VAR __ProductsToSearchFor = SELECTCOLUMNS('dimProduct',"__ProductName",[ProductName])
  // this gets the products selected in the slicer in a table with just ProductName column
  VAR __Table =
    ADDCOLUMNS(
      __ProductsToSearchFor,
      "__Total",
        VAR __String = [ProductName]
        VAR __Strings = CONCATENATEX('ProductsOfferedTable',[PRODUCT OFFERED],", ")
        VAR __Length = LEN(__String)
      RETURN
        ( LEN(__Strings) - LEN(SUBSTITUTE(__Strings,__String,"")) ) / __Length
    )
RETURN
  SUMX(__Table,[__Total])&lt;/LI-CODE&gt;</description>
      <pubDate>Fri, 17 Sep 2021 14:32:12 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Filter-a-table-based-on-concatenated-values/m-p/2082928#M47268</guid>
      <dc:creator>Greg_Deckler</dc:creator>
      <dc:date>2021-09-17T14:32:12Z</dc:date>
    </item>
    <item>
      <title>Re: Filter a table based on concatenated values</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Filter-a-table-based-on-concatenated-values/m-p/2083045#M47275</link>
      <description>&lt;P&gt;Thanks again &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;So I tested this formula in a card. When I select a single product, I have the right result. But when I select more than one product, some visits are counted twice.&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;REF&lt;/TD&gt;&lt;TD&gt;OFERRED PRODUCTS&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;001&lt;/TD&gt;&lt;TD&gt;AAA&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;002&lt;/TD&gt;&lt;TD&gt;AAA BBB&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;003&lt;/TD&gt;&lt;TD&gt;BBB&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If I select AAA and BBB in the silcer, the result will be 4 (instead of 3 which is the expected result because there are 3 commercial visits ).&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Also, if no product is selected in my slicer, the total is incorrect. It is much too high: 6599 instead of 1445. Again, if I select all products in the slicer the result is still to high : 1557 instead of 1445 visits in total.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 17 Sep 2021 15:09:25 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Filter-a-table-based-on-concatenated-values/m-p/2083045#M47275</guid>
      <dc:creator>DIACHROMA</dc:creator>
      <dc:date>2021-09-17T15:09:25Z</dc:date>
    </item>
    <item>
      <title>Re: Filter a table based on concatenated values</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Filter-a-table-based-on-concatenated-values/m-p/2083066#M47277</link>
      <description>&lt;P&gt;Ah yes indeed! When I filter my slicer products report the total is lower but still incorrect: 1557 (instead of 1445) probably because some visits are counted multiple times.&lt;/P&gt;</description>
      <pubDate>Fri, 17 Sep 2021 15:16:37 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Filter-a-table-based-on-concatenated-values/m-p/2083066#M47277</guid>
      <dc:creator>DIACHROMA</dc:creator>
      <dc:date>2021-09-17T15:16:37Z</dc:date>
    </item>
    <item>
      <title>Re: Filter a table based on concatenated values</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Filter-a-table-based-on-concatenated-values/m-p/2083111#M47281</link>
      <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="270902" data-lia-user-login="DIACHROMA" class="lia-mention lia-mention-user"&gt;DIACHROMA&lt;/a&gt;&amp;nbsp;OK, let's go this route then:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;Measure =
  VAR __ProductsToSearchFor = SELECTCOLUMNS('dimProduct',"__ProductName",[ProductName])
  // this gets the products selected in the slicer in a table with just ProductName column
  VAR __Table =
    ADDCOLUMNS(
      __ProductsToSearchFor,
      "__Refs",
        VAR __String = [ProductName]
        VAR __Refs = 
          CONCATENATEX(
            SELECTCOLUMNS(
              FILTER('ProductsOfferedTable',CONTAINSSTRING([PRODUCT OFFERED],__String)),
              "__Ref",[REF]
            ),
            [__Ref],"|"
          )
      RETURN
        [__Refs]
    )
  VAR __AllRefs = CONCATENATEX(__Table,[__Refs],"|")
  VAR __Count = COUNTROWS(__AllRefs)
  VAR __AllRefsTable = 
    ADDCOLUMNS(
      GENERATESERIES(1,__Count,1),
      "__Ref",PATHITEM(__AllRefs,[Value],TEXT)
    )
RETURN
  COUNTROWS(DISTINCT(SELECTCOLUMNS(__AllRefsTable,"__Ref",[__Ref])))&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 17 Sep 2021 15:55:35 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Filter-a-table-based-on-concatenated-values/m-p/2083111#M47281</guid>
      <dc:creator>Greg_Deckler</dc:creator>
      <dc:date>2021-09-17T15:55:35Z</dc:date>
    </item>
    <item>
      <title>Re: Filter a table based on concatenated values</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Filter-a-table-based-on-concatenated-values/m-p/2083136#M47288</link>
      <description>&lt;P&gt;I can't write :&lt;/P&gt;&lt;PRE&gt;  VAR __Count = COUNTROWS(__AllRefs)&lt;/PRE&gt;&lt;P&gt;It doesn't allow me to put "__AllRefs" in the COUNTROWS&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 17 Sep 2021 15:56:40 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Filter-a-table-based-on-concatenated-values/m-p/2083136#M47288</guid>
      <dc:creator>DIACHROMA</dc:creator>
      <dc:date>2021-09-17T15:56:40Z</dc:date>
    </item>
    <item>
      <title>Re: Filter a table based on concatenated values</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Filter-a-table-based-on-concatenated-values/m-p/2083179#M47297</link>
      <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="270902" data-lia-user-login="DIACHROMA" class="lia-mention lia-mention-user"&gt;DIACHROMA&lt;/a&gt;&amp;nbsp;My bad:&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;Measure =
  VAR __ProductsToSearchFor = SELECTCOLUMNS('dimProduct',"__ProductName",[ProductName])
  // this gets the products selected in the slicer in a table with just ProductName column
  VAR __Table =
    ADDCOLUMNS(
      __ProductsToSearchFor,
      "__Refs",
        VAR __String = [ProductName]
        VAR __Refs = 
          CONCATENATEX(
            SELECTCOLUMNS(
              FILTER('ProductsOfferedTable',CONTAINSSTRING([PRODUCT OFFERED],__String)),
              "__Ref",[REF]
            ),
            [__Ref],"|"
          )
      RETURN
        [__Refs]
    )
  VAR __AllRefs = CONCATENATEX(__Table,[__Refs],"|")
  VAR __Count = __Len - LEN(SUBSTITUTE(__AllRefs,"|","")) + 1
  VAR __AllRefsTable = 
    ADDCOLUMNS(
      GENERATESERIES(1,__Count,1),
      "__Ref",PATHITEM(__AllRefs,[Value],TEXT)
    )
RETURN
  COUNTROWS(DISTINCT(SELECTCOLUMNS(__AllRefsTable,"__Ref",[__Ref])))&lt;/LI-CODE&gt;</description>
      <pubDate>Fri, 17 Sep 2021 16:20:54 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Filter-a-table-based-on-concatenated-values/m-p/2083179#M47297</guid>
      <dc:creator>Greg_Deckler</dc:creator>
      <dc:date>2021-09-17T16:20:54Z</dc:date>
    </item>
    <item>
      <title>Re: Filter a table based on concatenated values</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Filter-a-table-based-on-concatenated-values/m-p/2083207#M47301</link>
      <description>&lt;P&gt;Sorry me again... In the VAR __Count I can't put __Len as it doesnt exist earlier as a var&lt;/P&gt;</description>
      <pubDate>Fri, 17 Sep 2021 16:48:16 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Filter-a-table-based-on-concatenated-values/m-p/2083207#M47301</guid>
      <dc:creator>DIACHROMA</dc:creator>
      <dc:date>2021-09-17T16:48:16Z</dc:date>
    </item>
    <item>
      <title>Re: Filter a table based on concatenated values</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Filter-a-table-based-on-concatenated-values/m-p/2083227#M47302</link>
      <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="270902" data-lia-user-login="DIACHROMA" class="lia-mention lia-mention-user"&gt;DIACHROMA&lt;/a&gt;&amp;nbsp;I'll get this right eventually:&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;Measure =
  VAR __ProductsToSearchFor = SELECTCOLUMNS('dimProduct',"__ProductName",[ProductName])
  // this gets the products selected in the slicer in a table with just ProductName column
  VAR __Table =
    ADDCOLUMNS(
      __ProductsToSearchFor,
      "__Refs",
        VAR __String = [ProductName]
        VAR __Refs = 
          CONCATENATEX(
            SELECTCOLUMNS(
              FILTER('ProductsOfferedTable',CONTAINSSTRING([PRODUCT OFFERED],__String)),
              "__Ref",[REF]
            ),
            [__Ref],"|"
          )
      RETURN
        [__Refs]
    )
  VAR __AllRefs = CONCATENATEX(__Table,[__Refs],"|")
  VAR __Count = LEN(__AllRefs) - LEN(SUBSTITUTE(__AllRefs,"|","")) + 1
  VAR __AllRefsTable = 
    ADDCOLUMNS(
      GENERATESERIES(1,__Count,1),
      "__Ref",PATHITEM(__AllRefs,[Value],TEXT)
    )
RETURN
  COUNTROWS(DISTINCT(SELECTCOLUMNS(__AllRefsTable,"__Ref",[__Ref])))&lt;/LI-CODE&gt;</description>
      <pubDate>Fri, 17 Sep 2021 17:03:37 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Filter-a-table-based-on-concatenated-values/m-p/2083227#M47302</guid>
      <dc:creator>Greg_Deckler</dc:creator>
      <dc:date>2021-09-17T17:03:37Z</dc:date>
    </item>
    <item>
      <title>Re: Filter a table based on concatenated values</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Filter-a-table-based-on-concatenated-values/m-p/2083261#M47303</link>
      <description>&lt;P&gt;&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;,&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Ok now we soooo close !!&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I get the correct result for all product individually AND with multiple selections except&amp;nbsp;for a product whose result must be 0, for this one I have 1.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;And therefore the total shows me 1446 instead of 1445.&lt;/P&gt;&lt;P&gt;I double-double checked and it should be 1445 - I don't have any visit for the product where I get 1.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm sorry I'm completely lost in your formula (way too complex for me) so I can't seem to figure out when the 1 can slip in instead of counting blank or 0.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you in advance for your help &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 17 Sep 2021 17:24:54 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Filter-a-table-based-on-concatenated-values/m-p/2083261#M47303</guid>
      <dc:creator>DIACHROMA</dc:creator>
      <dc:date>2021-09-17T17:24:54Z</dc:date>
    </item>
    <item>
      <title>Re: Filter a table based on concatenated values</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Filter-a-table-based-on-concatenated-values/m-p/2083354#M47306</link>
      <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="270902" data-lia-user-login="DIACHROMA" class="lia-mention lia-mention-user"&gt;DIACHROMA&lt;/a&gt;&amp;nbsp;OK, so I know you said you double-checked but could you check with this measure to see if it returns 1446 or 1445.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;Measure = COUNTROWS(DISTINCT(SELECTCOLUMNS('ProdutsOfferedTable',"__Ref",[REF])))&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 17 Sep 2021 18:40:11 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Filter-a-table-based-on-concatenated-values/m-p/2083354#M47306</guid>
      <dc:creator>Greg_Deckler</dc:creator>
      <dc:date>2021-09-17T18:40:11Z</dc:date>
    </item>
    <item>
      <title>Re: Filter a table based on concatenated values</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Filter-a-table-based-on-concatenated-values/m-p/2083357#M47307</link>
      <description>&lt;P&gt;It returns 1445&lt;/P&gt;</description>
      <pubDate>Fri, 17 Sep 2021 18:44:05 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Filter-a-table-based-on-concatenated-values/m-p/2083357#M47307</guid>
      <dc:creator>DIACHROMA</dc:creator>
      <dc:date>2021-09-17T18:44:05Z</dc:date>
    </item>
    <item>
      <title>Re: Filter a table based on concatenated values</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Filter-a-table-based-on-concatenated-values/m-p/2083361#M47308</link>
      <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="270902" data-lia-user-login="DIACHROMA" class="lia-mention lia-mention-user"&gt;DIACHROMA&lt;/a&gt;&amp;nbsp;OK, well that is odd then. What if you create a new &lt;STRONG&gt;table&lt;/STRONG&gt; like this and we can check what is being returned, maybe there is a blank row being returned and we can just filter it out. It's the exact same formula, you just return the __AllRefsTable instead.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;New Table =
  VAR __ProductsToSearchFor = SELECTCOLUMNS('dimProduct',"__ProductName",[ProductName])
  // this gets the products selected in the slicer in a table with just ProductName column
  VAR __Table =
    ADDCOLUMNS(
      __ProductsToSearchFor,
      "__Refs",
        VAR __String = [ProductName]
        VAR __Refs = 
          CONCATENATEX(
            SELECTCOLUMNS(
              FILTER('ProductsOfferedTable',CONTAINSSTRING([PRODUCT OFFERED],__String)),
              "__Ref",[REF]
            ),
            [__Ref],"|"
          )
      RETURN
        [__Refs]
    )
  VAR __AllRefs = CONCATENATEX(__Table,[__Refs],"|")
  VAR __Count = LEN(__AllRefs) - LEN(SUBSTITUTE(__AllRefs,"|","")) + 1
  VAR __AllRefsTable = 
    ADDCOLUMNS(
      GENERATESERIES(1,__Count,1),
      "__Ref",PATHITEM(__AllRefs,[Value],TEXT)
    )
RETURN
  __AllRefsTable&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 17 Sep 2021 18:48:34 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Filter-a-table-based-on-concatenated-values/m-p/2083361#M47308</guid>
      <dc:creator>Greg_Deckler</dc:creator>
      <dc:date>2021-09-17T18:48:34Z</dc:date>
    </item>
    <item>
      <title>Re: Filter a table based on concatenated values</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Filter-a-table-based-on-concatenated-values/m-p/2083387#M47311</link>
      <description>&lt;P&gt;It returns this error :&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 17 Sep 2021 19:17:31 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Filter-a-table-based-on-concatenated-values/m-p/2083387#M47311</guid>
      <dc:creator>DIACHROMA</dc:creator>
      <dc:date>2021-09-17T19:17:31Z</dc:date>
    </item>
    <item>
      <title>Re: Filter a table based on concatenated values</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Filter-a-table-based-on-concatenated-values/m-p/2083402#M47312</link>
      <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="270902" data-lia-user-login="DIACHROMA" class="lia-mention lia-mention-user"&gt;DIACHROMA&lt;/a&gt;&amp;nbsp;Well that makes no sense since the length of the text should be the same for the measure! Let's try another route, create this the same measure that returns 1446 but with this in the last RETURN line and maybe put it in a Card visual or something:&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;CONCATENATEX(DISTINCT(SELECTCOLUMNS(__AllRefsTable,"__Ref",[__Ref])),[__Ref],",")&lt;/LI-CODE&gt;
&lt;P&gt;What we are looking for is ",," for example or some other value that doesn't look quite right.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 17 Sep 2021 19:29:33 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Filter-a-table-based-on-concatenated-values/m-p/2083402#M47312</guid>
      <dc:creator>Greg_Deckler</dc:creator>
      <dc:date>2021-09-17T19:29:33Z</dc:date>
    </item>
    <item>
      <title>Re: Filter a table based on concatenated values</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Filter-a-table-based-on-concatenated-values/m-p/2083453#M47315</link>
      <description>&lt;P&gt;Ok ! I did it, it returns Visit IDs in one value. I export the result to excel to check it, I have 1445 IDs in total.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I don't know if it can help, but the 1 which is extra in the total appears when I select a product which should normally show me Blank or 0. Isn't there something in the formula that could make 1 to this product that should not appear?&lt;/P&gt;</description>
      <pubDate>Fri, 17 Sep 2021 20:02:25 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Filter-a-table-based-on-concatenated-values/m-p/2083453#M47315</guid>
      <dc:creator>DIACHROMA</dc:creator>
      <dc:date>2021-09-17T20:02:25Z</dc:date>
    </item>
    <item>
      <title>Re: Filter a table based on concatenated values</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Filter-a-table-based-on-concatenated-values/m-p/2083457#M47316</link>
      <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="270902" data-lia-user-login="DIACHROMA" class="lia-mention lia-mention-user"&gt;DIACHROMA&lt;/a&gt;&amp;nbsp;OK, try this as the RETURN then:&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;COUNTROWS(DISTINCT(SELECTCOLUMNS(FILTER(__AllRefsTable,[__Ref]&amp;lt;&amp;gt;BLANK()),"__Ref",[__Ref])))&lt;/LI-CODE&gt;</description>
      <pubDate>Fri, 17 Sep 2021 20:06:40 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Filter-a-table-based-on-concatenated-values/m-p/2083457#M47316</guid>
      <dc:creator>Greg_Deckler</dc:creator>
      <dc:date>2021-09-17T20:06:40Z</dc:date>
    </item>
  </channel>
</rss>

