<?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: Calculate with multiple contains filters in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculate-with-multiple-contains-filters/m-p/2898931#M94345</link>
    <description>&lt;P&gt;Hi&amp;nbsp; &lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="470203" data-lia-user-login="NMOORE" class="lia-mention lia-mention-user"&gt;NMOORE&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;
&lt;P&gt;Here are the steps you can follow：&lt;/P&gt;
&lt;P&gt;1. Create calculated column.&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;Tier 1 Total =
var _1={"NOP1","NOP2","NOP3"}
return
SUMX(FILTER(ALL('Table'),
CONTAINSSTRING('Table'[CBS Code],"1.1.2.4")&amp;amp;&amp;amp;
'Table'[CBS Name] in _1),[Budget])&lt;/LI-CODE&gt;
&lt;P&gt;2. Result:&lt;/P&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If the results don't meet your expectations, can you share sample data and sample output in table format? Or a sample pbix after removing sensitive data. We can better understand the problem and help you&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Best Regards,&lt;/P&gt;
&lt;P&gt;Liu Yang&lt;/P&gt;
&lt;P&gt;If this post &lt;STRONG&gt;helps&lt;/STRONG&gt;, then please consider &lt;EM&gt;Accept it as the solution&lt;/EM&gt; to help the other members find it more quickly&lt;/P&gt;</description>
    <pubDate>Fri, 11 Nov 2022 02:33:14 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2022-11-11T02:33:14Z</dc:date>
    <item>
      <title>Calculate with multiple contains filters</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculate-with-multiple-contains-filters/m-p/2898135#M94307</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm trying to sum one column based on subsequent filers in DAX. Hopefully the below demonstrates what I want to do:&lt;/P&gt;&lt;DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;STRONG&gt;&lt;EM&gt;Tier 1 Total = &lt;/EM&gt;&lt;/STRONG&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;STRONG&gt;&lt;EM&gt;&amp;nbsp; &amp;nbsp; CALCULATE(&lt;/EM&gt;&lt;/STRONG&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;STRONG&gt;&lt;EM&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; SUM(Table_A&amp;nbsp;[Budget]), &lt;/EM&gt;&lt;/STRONG&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;STRONG&gt;&lt;EM&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; FILTER(Table_A,CONTAINSSTRING(Table_A[CBS Code],"1.1.2.4")),&lt;/EM&gt;&lt;/STRONG&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;STRONG&gt;&lt;EM&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; FILTER(Table_A,CONTAINSSTRING(Table_A[CBS Name], "NOP1")),&lt;/EM&gt;&lt;/STRONG&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;EM&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; FILTER(Table_A,CONTAINSSTRING(Table_A[CBS Name], "NOP2")),&lt;/EM&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;EM&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; FILTER(Table_A,CONTAINSSTRING(Table_A[CBS Name], "NOP3")))&lt;/EM&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If I use the the formula in bold it's fine. However I want to include multiple contain filters on [CBS name] and include all 3. I can find what to do if they are straight forward filters but as I'm using the contains feature it makes it a bit trickier. I've tried || and IN functions and failed.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I could probably make it work creating multiple variables and summing them together but it feels like it should be easier.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I really appreciate any help.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;</description>
      <pubDate>Thu, 10 Nov 2022 17:16:06 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculate-with-multiple-contains-filters/m-p/2898135#M94307</guid>
      <dc:creator>NMOORE</dc:creator>
      <dc:date>2022-11-10T17:16:06Z</dc:date>
    </item>
    <item>
      <title>Re: Calculate with multiple contains filters</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculate-with-multiple-contains-filters/m-p/2898931#M94345</link>
      <description>&lt;P&gt;Hi&amp;nbsp; &lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="470203" data-lia-user-login="NMOORE" class="lia-mention lia-mention-user"&gt;NMOORE&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;
&lt;P&gt;Here are the steps you can follow：&lt;/P&gt;
&lt;P&gt;1. Create calculated column.&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;Tier 1 Total =
var _1={"NOP1","NOP2","NOP3"}
return
SUMX(FILTER(ALL('Table'),
CONTAINSSTRING('Table'[CBS Code],"1.1.2.4")&amp;amp;&amp;amp;
'Table'[CBS Name] in _1),[Budget])&lt;/LI-CODE&gt;
&lt;P&gt;2. Result:&lt;/P&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If the results don't meet your expectations, can you share sample data and sample output in table format? Or a sample pbix after removing sensitive data. We can better understand the problem and help you&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Best Regards,&lt;/P&gt;
&lt;P&gt;Liu Yang&lt;/P&gt;
&lt;P&gt;If this post &lt;STRONG&gt;helps&lt;/STRONG&gt;, then please consider &lt;EM&gt;Accept it as the solution&lt;/EM&gt; to help the other members find it more quickly&lt;/P&gt;</description>
      <pubDate>Fri, 11 Nov 2022 02:33:14 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculate-with-multiple-contains-filters/m-p/2898931#M94345</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2022-11-11T02:33:14Z</dc:date>
    </item>
    <item>
      <title>Re: Calculate with multiple contains filters</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculate-with-multiple-contains-filters/m-p/2900006#M94408</link>
      <description>&lt;P&gt;Thanks alot for your reply. I would upload a PBIX file but it won't let me. It's returning a blank on my data.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If you add text at the end of CBS code and CBS name values on your table as per below it wont filter accordingly.&amp;nbsp; I'm not sure why the contains string function is not working?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;TABLE border="0" cellspacing="0" cellpadding="0"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;CBS Code&lt;/TD&gt;&lt;TD&gt;CBS Name&lt;/TD&gt;&lt;TD&gt;Budget&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;1.1.2.3.21&lt;/TD&gt;&lt;TD&gt;NOP1 EX1&lt;/TD&gt;&lt;TD&gt;1&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;1.1.2.3.21&lt;/TD&gt;&lt;TD&gt;NOP2 EX1&lt;/TD&gt;&lt;TD&gt;2&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;1.1.2.3.21&lt;/TD&gt;&lt;TD&gt;NOP2 EX1&lt;/TD&gt;&lt;TD&gt;5&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;1.1.2.4.21&lt;/TD&gt;&lt;TD&gt;NOP1EX1&lt;/TD&gt;&lt;TD&gt;6&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;1.1.2.4.21&lt;/TD&gt;&lt;TD&gt;NOP2EX1&lt;/TD&gt;&lt;TD&gt;4&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;1.1.2.4.21&lt;/TD&gt;&lt;TD&gt;NOP3 EX1&lt;/TD&gt;&lt;TD&gt;7&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;1.1.2.4.21&lt;/TD&gt;&lt;TD&gt;NOP4 EX1&lt;/TD&gt;&lt;TD&gt;1&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;1.1.2.4.222.1&lt;/TD&gt;&lt;TD&gt;NOP1EX1&lt;/TD&gt;&lt;TD&gt;5&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;1.1.2.4.222.1&lt;/TD&gt;&lt;TD&gt;NOP2EX1&lt;/TD&gt;&lt;TD&gt;5&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks again&lt;/P&gt;</description>
      <pubDate>Fri, 11 Nov 2022 11:13:09 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculate-with-multiple-contains-filters/m-p/2900006#M94408</guid>
      <dc:creator>NMOORE</dc:creator>
      <dc:date>2022-11-11T11:13:09Z</dc:date>
    </item>
  </channel>
</rss>

