<?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 Filtering to columns that contain a certain string, &amp;amp; only on and after a given date in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Filtering-to-columns-that-contain-a-certain-string-amp-only-on/m-p/3061089#M105763</link>
    <description>&lt;P&gt;Hi community,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I was given help months ago to come up with a script; it's been working wonderfully.&amp;nbsp; I now need to expand it.&amp;nbsp; This is how it looks currently:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;CALCULATETABLE (&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; ADDCOLUMNS (&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; SUMMARIZE ( 'CM360', 'CM360'[Date], 'CM360'[Placement ID] ),&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; "Cost-per-day",&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; CALCULATE( SUM(('CM360'[impressions])) / 1000) * 4&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; ),&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; 'CM360'[site_cm360] = "Programmatic Ads"&amp;nbsp; &amp;nbsp;&lt;/P&gt;&lt;P&gt;)&lt;/P&gt;&lt;P&gt;---------------------------------------------------------------------------------------------------------------------------------&lt;/P&gt;&lt;P&gt;You can see we've created a calculated table where we've taken the [Date] and&amp;nbsp;[Placement ID] columns from an existing table, 'CM360'.&amp;nbsp; We've then created another column, "Cost-per-day", calculated by taking [impressions], dividing that by 1000, then multiplying by 4 dollars. Only where the column, 'CM360'[site_cm360], contains&amp;nbsp;"Programmatic Ads".&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I would now like to expand that script to something like this:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; CALCULATETABLE (&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; ADDCOLUMNS (&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; FILTER ( 'CM360', (CONTAINSSTRING('CM360' ['Placement'], “banner”)), 'CM360'[Date] &amp;gt;= 01/09/2022 ),&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; SUMMARIZE ( 'CM360', 'CM360'[Date], 'CM360'[Placement ID] ),&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; "Cost-per-day",&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; CALCULATE( SUM(('CM360'[impressions])) / 1000) * 5.00&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; ),&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; 'CM360'[site_cm360] = "Programmatic Ads" OR “iAgency”&lt;/P&gt;&lt;P&gt;)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I wish to filter what we were doing before to rows where&amp;nbsp;'CM360' ['Placement'] column contains the string "banner".&lt;/P&gt;&lt;P&gt;And only where those rows have the date on or after September 1st 2022.&lt;/P&gt;&lt;P&gt;Additionally, in that last line, I wish to expand it so it now looks for those two different values in the column,&amp;nbsp;&amp;nbsp; 'CM360'[site_cm360]&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Please can you look at my expanded script and help me understand how you would write it because I don't think this is how it should be written in DAX.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;thank-you&amp;nbsp; &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;</description>
    <pubDate>Fri, 03 Feb 2023 21:06:06 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2023-02-03T21:06:06Z</dc:date>
    <item>
      <title>Filtering to columns that contain a certain string, &amp; only on and after a given date</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Filtering-to-columns-that-contain-a-certain-string-amp-only-on/m-p/3061089#M105763</link>
      <description>&lt;P&gt;Hi community,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I was given help months ago to come up with a script; it's been working wonderfully.&amp;nbsp; I now need to expand it.&amp;nbsp; This is how it looks currently:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;CALCULATETABLE (&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; ADDCOLUMNS (&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; SUMMARIZE ( 'CM360', 'CM360'[Date], 'CM360'[Placement ID] ),&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; "Cost-per-day",&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; CALCULATE( SUM(('CM360'[impressions])) / 1000) * 4&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; ),&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; 'CM360'[site_cm360] = "Programmatic Ads"&amp;nbsp; &amp;nbsp;&lt;/P&gt;&lt;P&gt;)&lt;/P&gt;&lt;P&gt;---------------------------------------------------------------------------------------------------------------------------------&lt;/P&gt;&lt;P&gt;You can see we've created a calculated table where we've taken the [Date] and&amp;nbsp;[Placement ID] columns from an existing table, 'CM360'.&amp;nbsp; We've then created another column, "Cost-per-day", calculated by taking [impressions], dividing that by 1000, then multiplying by 4 dollars. Only where the column, 'CM360'[site_cm360], contains&amp;nbsp;"Programmatic Ads".&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I would now like to expand that script to something like this:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; CALCULATETABLE (&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; ADDCOLUMNS (&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; FILTER ( 'CM360', (CONTAINSSTRING('CM360' ['Placement'], “banner”)), 'CM360'[Date] &amp;gt;= 01/09/2022 ),&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; SUMMARIZE ( 'CM360', 'CM360'[Date], 'CM360'[Placement ID] ),&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; "Cost-per-day",&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; CALCULATE( SUM(('CM360'[impressions])) / 1000) * 5.00&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; ),&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; 'CM360'[site_cm360] = "Programmatic Ads" OR “iAgency”&lt;/P&gt;&lt;P&gt;)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I wish to filter what we were doing before to rows where&amp;nbsp;'CM360' ['Placement'] column contains the string "banner".&lt;/P&gt;&lt;P&gt;And only where those rows have the date on or after September 1st 2022.&lt;/P&gt;&lt;P&gt;Additionally, in that last line, I wish to expand it so it now looks for those two different values in the column,&amp;nbsp;&amp;nbsp; 'CM360'[site_cm360]&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Please can you look at my expanded script and help me understand how you would write it because I don't think this is how it should be written in DAX.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;thank-you&amp;nbsp; &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 03 Feb 2023 21:06:06 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Filtering-to-columns-that-contain-a-certain-string-amp-only-on/m-p/3061089#M105763</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2023-02-03T21:06:06Z</dc:date>
    </item>
    <item>
      <title>Re: Filtering to columns that contain a certain string, &amp; only on and after a given date</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Filtering-to-columns-that-contain-a-certain-string-amp-only-on/m-p/3061172#M105769</link>
      <description>&lt;P&gt;hi Anonymous&lt;/LI-USER&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;try like:&lt;/P&gt;&lt;DIV&gt;Table =&lt;/DIV&gt;&lt;DIV&gt;VAR _table =&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;CALCULATETABLE (&amp;nbsp;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;'CM360',&amp;nbsp;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;CONTAINSSTRING('CM360' ['Placement'], “banner”),&amp;nbsp;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;'CM360'[Date] &amp;gt;= DATE(2022, 9, 1)&amp;nbsp;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;)&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;RETURN&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;CALCULATETABLE (&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; ADDCOLUMNS (&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;SUMMARIZE (&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;_table&lt;/SPAN&gt;&lt;SPAN&gt;,&amp;nbsp;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;'CM360'[Date],&amp;nbsp;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;'CM360'[Placement ID]&amp;nbsp;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;),&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; "Cost-per-day",&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; CALCULATE( SUM('CM360'[impressions]) / 1000) * 5.00&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;),&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; 'CM360'[site_cm360]&amp;nbsp; IN {"Programmatic Ads", "iAgency"}&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;)&lt;/SPAN&gt;&lt;/DIV&gt;</description>
      <pubDate>Fri, 03 Feb 2023 22:33:44 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Filtering-to-columns-that-contain-a-certain-string-amp-only-on/m-p/3061172#M105769</guid>
      <dc:creator>FreemanZ</dc:creator>
      <dc:date>2023-02-03T22:33:44Z</dc:date>
    </item>
    <item>
      <title>Re: Filtering to columns that contain a certain string, &amp; only on and after a given date</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Filtering-to-columns-that-contain-a-certain-string-amp-only-on/m-p/3063853#M106010</link>
      <description>&lt;P&gt;thank-you&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="460868" data-lia-user-login="FreemanZ" class="lia-mention lia-mention-user"&gt;FreemanZ&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I inserted your block of code into my script:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;PowerBI gives an error message, "Cannot find 'Table' "&amp;nbsp; "Parameter is not the correct type".&amp;nbsp; This is my full script:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;I've tried various edits, including adding more parenthesis, but I just can't get Power BI to accept &amp;amp; execute this script.&amp;nbsp; Any suggestions would be much appreciated &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;Pablo&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 06 Feb 2023 13:07:05 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Filtering-to-columns-that-contain-a-certain-string-amp-only-on/m-p/3063853#M106010</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2023-02-06T13:07:05Z</dc:date>
    </item>
    <item>
      <title>Re: Filtering to columns that contain a certain string, &amp; only on and after a given date</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Filtering-to-columns-that-contain-a-certain-string-amp-only-on/m-p/3083754#M107640</link>
      <description>&lt;P&gt;thanks again&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="460868" data-lia-user-login="FreemanZ" class="lia-mention lia-mention-user"&gt;FreemanZ&lt;/a&gt;&amp;nbsp; &amp;nbsp;I was able to take your code, modify and expand on it, then incorportate it into my larger script.&amp;nbsp; It works now, and I'm very grateful for all the help &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 16 Feb 2023 17:08:30 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Filtering-to-columns-that-contain-a-certain-string-amp-only-on/m-p/3083754#M107640</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2023-02-16T17:08:30Z</dc:date>
    </item>
  </channel>
</rss>

