<?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: Need help with DAX to get similar function LIKE in SQL in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Need-help-with-DAX-to-get-similar-function-LIKE-in-SQL/m-p/3333798#M124992</link>
    <description>&lt;P&gt;Hi&amp;nbsp;Anonymous&lt;/LI-USER&gt;&amp;nbsp;,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;You can create a DAX measure in Power BI to replicate the SQL query you provided. Here's a DAX measure that should give you the desired result:&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;Total Amount Excluding CRA = 
CALCULATE(
    SUM(TABLE1[AMOUNT]),
    FILTER(
        TABLE1,
        NOT (CONTAINSSTRING(TABLE1[REVENUE_TYPE], "CRA"))
    )
)&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;This measure calculates the sum of the &lt;EM&gt;&lt;STRONG&gt;AMOUNT&lt;/STRONG&gt;&lt;/EM&gt; column in &lt;STRONG&gt;&lt;EM&gt;TABLE1&lt;/EM&gt;&lt;/STRONG&gt; while excluding rows where the &lt;EM&gt;&lt;STRONG&gt;REVENUE_TYPE&lt;/STRONG&gt;&lt;/EM&gt; contains &lt;EM&gt;&lt;STRONG&gt;"CRA"&lt;/STRONG&gt;&lt;/EM&gt;.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Best Regards,&lt;/P&gt;
&lt;P&gt;Jianbo Li&lt;/P&gt;
&lt;P&gt;If this post&amp;nbsp;&lt;STRONG&gt;&lt;EM&gt;helps&lt;/EM&gt;&lt;/STRONG&gt;, then please consider&amp;nbsp;&lt;STRONG&gt;&lt;EM&gt;Accept it as the solution&lt;/EM&gt;&lt;/STRONG&gt;&amp;nbsp;to help the other members find it more quickly.&lt;/P&gt;</description>
    <pubDate>Wed, 19 Jul 2023 01:41:09 GMT</pubDate>
    <dc:creator>v-jianboli-msft</dc:creator>
    <dc:date>2023-07-19T01:41:09Z</dc:date>
    <item>
      <title>Need help with DAX to get similar function LIKE in SQL</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Need-help-with-DAX-to-get-similar-function-LIKE-in-SQL/m-p/3331111#M124829</link>
      <description>&lt;P&gt;I am getting an issue in creating a DAX function in Power BI.&lt;BR /&gt;My Query&lt;/P&gt;&lt;P&gt;SELECT SUM(AMOUNT) FROM TABLE1&lt;/P&gt;&lt;P&gt;WHERE REVENUE_TYPE NOT LIKE '%CRA';&lt;/P&gt;&lt;P&gt;I want to replicate this thing in Power BI using DAX. Need some inputs&lt;BR /&gt;Thanks!&lt;/P&gt;</description>
      <pubDate>Fri, 14 Jul 2023 10:23:04 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Need-help-with-DAX-to-get-similar-function-LIKE-in-SQL/m-p/3331111#M124829</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2023-07-14T10:23:04Z</dc:date>
    </item>
    <item>
      <title>Re: Need help with DAX to get similar function LIKE in SQL</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Need-help-with-DAX-to-get-similar-function-LIKE-in-SQL/m-p/3331119#M124831</link>
      <description>&lt;P&gt;Hi,&lt;BR /&gt;&lt;BR /&gt;Here is an example:&lt;/P&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Dax:&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;
&lt;DIV&gt;
&lt;DIV&gt;&lt;SPAN&gt;SUM not cra = &lt;/SPAN&gt;&lt;SPAN&gt;CALCULATE&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;SUM&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;'Table (36)'&lt;/SPAN&gt;&lt;SPAN&gt;[Value]&lt;/SPAN&gt;&lt;SPAN&gt;),&lt;/SPAN&gt;&lt;SPAN&gt;ALL&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;'Table (36)'&lt;/SPAN&gt;&lt;SPAN&gt;),&lt;/SPAN&gt;&lt;SPAN&gt;'Table (36)'&lt;/SPAN&gt;&lt;SPAN&gt;[Revenue type]&lt;/SPAN&gt;&lt;SPAN&gt; &amp;lt;&amp;gt; &lt;/SPAN&gt;&lt;SPAN&gt;"CRA"&lt;/SPAN&gt;&lt;SPAN&gt;)&lt;BR /&gt;End result:&lt;BR /&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;img /&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
I hope this post helps to solve your issue and if it does consider accepting it as a solution and giving the post a thumbs up!&lt;BR /&gt;&lt;BR /&gt;My LinkedIn: &lt;A href="https://www.linkedin.com/in/n%C3%A4ttiahov-00001/" target="_blank"&gt;https://www.linkedin.com/in/n%C3%A4ttiahov-00001/&lt;/A&gt;&lt;/DIV&gt;
&lt;/DIV&gt;</description>
      <pubDate>Fri, 14 Jul 2023 10:33:25 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Need-help-with-DAX-to-get-similar-function-LIKE-in-SQL/m-p/3331119#M124831</guid>
      <dc:creator>ValtteriN</dc:creator>
      <dc:date>2023-07-14T10:33:25Z</dc:date>
    </item>
    <item>
      <title>Re: Need help with DAX to get similar function LIKE in SQL</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Need-help-with-DAX-to-get-similar-function-LIKE-in-SQL/m-p/3331122#M124832</link>
      <description>&lt;P&gt;I understood the above concept or logic. But my issue is with the LIKE operator. How to implement that in DAX. And you can see it should filter the values starts with "CRA".&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;====&amp;gt; WHERE REVENUE_TYPE NOT LIKE '%CRA';&lt;/SPAN&gt;&lt;BR /&gt;Not equal to would been easier but it is not!&lt;/P&gt;</description>
      <pubDate>Fri, 14 Jul 2023 10:38:11 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Need-help-with-DAX-to-get-similar-function-LIKE-in-SQL/m-p/3331122#M124832</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2023-07-14T10:38:11Z</dc:date>
    </item>
    <item>
      <title>Re: Need help with DAX to get similar function LIKE in SQL</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Need-help-with-DAX-to-get-similar-function-LIKE-in-SQL/m-p/3333798#M124992</link>
      <description>&lt;P&gt;Hi&amp;nbsp;Anonymous&lt;/LI-USER&gt;&amp;nbsp;,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;You can create a DAX measure in Power BI to replicate the SQL query you provided. Here's a DAX measure that should give you the desired result:&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;Total Amount Excluding CRA = 
CALCULATE(
    SUM(TABLE1[AMOUNT]),
    FILTER(
        TABLE1,
        NOT (CONTAINSSTRING(TABLE1[REVENUE_TYPE], "CRA"))
    )
)&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;This measure calculates the sum of the &lt;EM&gt;&lt;STRONG&gt;AMOUNT&lt;/STRONG&gt;&lt;/EM&gt; column in &lt;STRONG&gt;&lt;EM&gt;TABLE1&lt;/EM&gt;&lt;/STRONG&gt; while excluding rows where the &lt;EM&gt;&lt;STRONG&gt;REVENUE_TYPE&lt;/STRONG&gt;&lt;/EM&gt; contains &lt;EM&gt;&lt;STRONG&gt;"CRA"&lt;/STRONG&gt;&lt;/EM&gt;.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Best Regards,&lt;/P&gt;
&lt;P&gt;Jianbo Li&lt;/P&gt;
&lt;P&gt;If this post&amp;nbsp;&lt;STRONG&gt;&lt;EM&gt;helps&lt;/EM&gt;&lt;/STRONG&gt;, then please consider&amp;nbsp;&lt;STRONG&gt;&lt;EM&gt;Accept it as the solution&lt;/EM&gt;&lt;/STRONG&gt;&amp;nbsp;to help the other members find it more quickly.&lt;/P&gt;</description>
      <pubDate>Wed, 19 Jul 2023 01:41:09 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Need-help-with-DAX-to-get-similar-function-LIKE-in-SQL/m-p/3333798#M124992</guid>
      <dc:creator>v-jianboli-msft</dc:creator>
      <dc:date>2023-07-19T01:41:09Z</dc:date>
    </item>
    <item>
      <title>Re: Need help with DAX to get similar function LIKE in SQL</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Need-help-with-DAX-to-get-similar-function-LIKE-in-SQL/m-p/3335661#M125090</link>
      <description>&lt;P&gt;I tried this method and it worked for import method,&lt;/P&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;src_rev&lt;/SPAN&gt;&lt;SPAN&gt; = &lt;/SPAN&gt;&lt;SPAN&gt;CALCULATE&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;SUM&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;AECG_VARICENT_INCENTIVE_HISTORY&lt;/SPAN&gt;&lt;SPAN&gt;[SPLIT_AMOUNT]&lt;/SPAN&gt;&lt;SPAN&gt;),&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; &lt;/SPAN&gt;&lt;SPAN&gt;NOT&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;CONTAINSSTRING&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;AECG_VARICENT_INCENTIVE_HISTORY&lt;/SPAN&gt;&lt;SPAN&gt;[REVENUE_TYPE]&lt;/SPAN&gt;&lt;SPAN&gt;,&lt;/SPAN&gt;&lt;SPAN&gt;"CRA"&lt;/SPAN&gt;&lt;SPAN&gt;)))&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;Thanks for the answers and suggestions!&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/DIV&gt;</description>
      <pubDate>Tue, 18 Jul 2023 05:52:55 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Need-help-with-DAX-to-get-similar-function-LIKE-in-SQL/m-p/3335661#M125090</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2023-07-18T05:52:55Z</dc:date>
    </item>
  </channel>
</rss>

