<?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: Dax command to count occurances of strings across multiple columns/cell with comma deliminated list in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Dax-command-to-count-occurances-of-strings-across-multiple/m-p/4622775#M176945</link>
    <description>&lt;P&gt;When data is coming in a format like that your first action is to unpivot it to make it usable.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;P&gt;Then when you load it to Power BI the rest can be done even with implicit measures, no code required.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Mon, 24 Mar 2025 17:00:33 GMT</pubDate>
    <dc:creator>lbendlin</dc:creator>
    <dc:date>2025-03-24T17:00:33Z</dc:date>
    <item>
      <title>Dax command to count occurances of strings across multiple columns/cell with comma deliminated list</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Dax-command-to-count-occurances-of-strings-across-multiple/m-p/4622604#M176940</link>
      <description>&lt;P&gt;Hi all!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm working with a database that contains a list of projects/facilities and the products they produce. The products are listed both in a single cell separated by commas and I have split the cell into multiple columns containing a single product. I have also created a separate table containing a list of all the unique products. For example, here a rough idea of what the table looks like (though the full version has 6 product columns since that's the highest number of products). It also has a variety of other attributes for each facility that I would like to be able to filter the visual with i.e. Location etc.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;TABLE border="1"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;&lt;STRONG&gt;Project&lt;/STRONG&gt;&lt;/TD&gt;&lt;TD&gt;&lt;STRONG&gt;Product Sets&lt;/STRONG&gt;&lt;/TD&gt;&lt;TD&gt;&lt;STRONG&gt;Product 1&lt;/STRONG&gt;&lt;/TD&gt;&lt;TD&gt;&lt;STRONG&gt;Product 2&lt;/STRONG&gt;&lt;/TD&gt;&lt;TD&gt;&lt;STRONG&gt;Product 3&lt;/STRONG&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;Facility A&lt;/TD&gt;&lt;TD&gt;Tea, Coffee, Filters&lt;/TD&gt;&lt;TD&gt;Tea&lt;/TD&gt;&lt;TD&gt;Coffee&lt;/TD&gt;&lt;TD&gt;Filters&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;Facility B&lt;/TD&gt;&lt;TD&gt;Coffee, Filters&lt;/TD&gt;&lt;TD&gt;Coffee&lt;/TD&gt;&lt;TD&gt;Filters&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;Facility C&lt;/TD&gt;&lt;TD&gt;Coffee&lt;/TD&gt;&lt;TD&gt;Coffee&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The separate table of unique products:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;TABLE border="1"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;&lt;STRONG&gt;Unique Products&lt;/STRONG&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;Tea&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;Coffee&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;Filters&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Target end result:&lt;/P&gt;&lt;TABLE border="1"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;&lt;STRONG&gt;Product&lt;/STRONG&gt;&lt;/TD&gt;&lt;TD&gt;&lt;STRONG&gt;Count of Rows/Projects&lt;/STRONG&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;Tea&lt;/TD&gt;&lt;TD&gt;1&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;Coffee&lt;/TD&gt;&lt;TD&gt;3&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;Filters&lt;/TD&gt;&lt;TD&gt;2&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I can get accurate results for one column at a time by creating a relationship between the Unique Product and one of the Product 1/2/3 columns, but not for the product set or other numbered columns.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm not sure if Dax is the appropriate mechanism for accomplishing this, but from the threads I've viewed it seems like the best way to go. Is there a way to go about calculating this with the database set up as it is? Are there any changes I need to make to the databse to calculate it?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks in advance for any help!&lt;/P&gt;</description>
      <pubDate>Mon, 24 Mar 2025 14:51:10 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Dax-command-to-count-occurances-of-strings-across-multiple/m-p/4622604#M176940</guid>
      <dc:creator>RichardTTH</dc:creator>
      <dc:date>2025-03-24T14:51:10Z</dc:date>
    </item>
    <item>
      <title>Re: Dax command to count occurances of strings across multiple columns/cell with comma deliminated list</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Dax-command-to-count-occurances-of-strings-across-multiple/m-p/4622768#M176944</link>
      <description>&lt;P&gt;I would change the model. Have a table for all your facilities, with location etc data in it. There are a couple of ways you could handle the projects and products. A lot would depend on how much, if any, info you have that is specific to a project. If there is a lot of data on projects then have a separate table for projects which you would link to the facilities table. You would also then want a table containing Project and Product, one row for every combination, and link this table to your Projects and Unique Products tables.&lt;/P&gt;
&lt;P&gt;If there isn't much data about projects then combine that with the products and have a table containing Facility, Project, Product, with 1 row for every combination of project and product.&lt;/P&gt;
&lt;P&gt;You would still want the separate table for unique products, which you would link to the combined table.&lt;/P&gt;
&lt;P&gt;The version where you combine Facility, Project and Product into 1 table would make for simpler DAX. The number of projects would be a simple DISTINCTCOUNT( 'Table'[Project] ) and this would be filterable by product as well as anything from the facilities table.&lt;/P&gt;</description>
      <pubDate>Mon, 24 Mar 2025 16:57:30 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Dax-command-to-count-occurances-of-strings-across-multiple/m-p/4622768#M176944</guid>
      <dc:creator>johnt75</dc:creator>
      <dc:date>2025-03-24T16:57:30Z</dc:date>
    </item>
    <item>
      <title>Re: Dax command to count occurances of strings across multiple columns/cell with comma deliminated list</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Dax-command-to-count-occurances-of-strings-across-multiple/m-p/4622775#M176945</link>
      <description>&lt;P&gt;When data is coming in a format like that your first action is to unpivot it to make it usable.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;P&gt;Then when you load it to Power BI the rest can be done even with implicit measures, no code required.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 24 Mar 2025 17:00:33 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Dax-command-to-count-occurances-of-strings-across-multiple/m-p/4622775#M176945</guid>
      <dc:creator>lbendlin</dc:creator>
      <dc:date>2025-03-24T17:00:33Z</dc:date>
    </item>
    <item>
      <title>Re: Dax command to count occurances of strings across multiple columns/cell with comma deliminated list</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Dax-command-to-count-occurances-of-strings-across-multiple/m-p/4622790#M176947</link>
      <description>&lt;P&gt;Perfect, this solved my issue. Thanks a bunch!&lt;/P&gt;</description>
      <pubDate>Mon, 24 Mar 2025 17:13:27 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Dax-command-to-count-occurances-of-strings-across-multiple/m-p/4622790#M176947</guid>
      <dc:creator>RichardTTH</dc:creator>
      <dc:date>2025-03-24T17:13:27Z</dc:date>
    </item>
  </channel>
</rss>

