<?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 If dax with columns in Developer</title>
    <link>https://community.fabric.microsoft.com/t5/Developer/If-dax-with-columns/m-p/3479448#M44951</link>
    <description>&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;Hi Im trying to write the below if statement.&amp;nbsp; the if funtion wants the 2 columns to be measures.&amp;nbsp; so I used the selecedvalue to turn the columns into measures. but I am getting the error: do not surrport compairing values of type text with values of type&amp;nbsp;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;DAX:&amp;nbsp; &amp;nbsp;SFFandCCRC_indicator = &lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;var&lt;/SPAN&gt; &lt;SPAN&gt;blue&lt;/SPAN&gt;&lt;SPAN&gt; = &lt;/SPAN&gt;&lt;SPAN&gt;SELECTEDVALUE&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;ProviderInfo[SFF]&lt;/SPAN&gt;&lt;SPAN&gt;)&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;var&lt;/SPAN&gt; &lt;SPAN&gt;green&lt;/SPAN&gt;&lt;SPAN&gt; = &lt;/SPAN&gt;&lt;SPAN&gt;SELECTEDVALUE&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;PIPastMonth1[Special Focus Status]&lt;/SPAN&gt;&lt;SPAN&gt;)&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;return&lt;/SPAN&gt; &lt;SPAN&gt;if&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;OR&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;blue&lt;/SPAN&gt;&lt;SPAN&gt; = &amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;or&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;"SFF"&lt;/SPAN&gt;&lt;SPAN&gt;, &lt;/SPAN&gt;&lt;SPAN&gt;"SFF Candidate"&lt;/SPAN&gt;&lt;SPAN&gt;), (&lt;/SPAN&gt;&lt;SPAN&gt;green&lt;/SPAN&gt;&lt;SPAN&gt; = &lt;/SPAN&gt;&lt;SPAN&gt;or&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;"SFF"&lt;/SPAN&gt;&lt;SPAN&gt;, &lt;/SPAN&gt;&lt;SPAN&gt;"SFF Candidate"&lt;/SPAN&gt;&lt;SPAN&gt;))), &lt;/SPAN&gt;&lt;SPAN&gt;"True"&lt;/SPAN&gt;&lt;SPAN&gt;, &lt;/SPAN&gt;&lt;SPAN&gt;"False"&lt;/SPAN&gt;&lt;SPAN&gt;)&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/DIV&gt;</description>
    <pubDate>Mon, 16 Oct 2023 17:19:19 GMT</pubDate>
    <dc:creator>22LACMT</dc:creator>
    <dc:date>2023-10-16T17:19:19Z</dc:date>
    <item>
      <title>If dax with columns</title>
      <link>https://community.fabric.microsoft.com/t5/Developer/If-dax-with-columns/m-p/3479448#M44951</link>
      <description>&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;Hi Im trying to write the below if statement.&amp;nbsp; the if funtion wants the 2 columns to be measures.&amp;nbsp; so I used the selecedvalue to turn the columns into measures. but I am getting the error: do not surrport compairing values of type text with values of type&amp;nbsp;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;DAX:&amp;nbsp; &amp;nbsp;SFFandCCRC_indicator = &lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;var&lt;/SPAN&gt; &lt;SPAN&gt;blue&lt;/SPAN&gt;&lt;SPAN&gt; = &lt;/SPAN&gt;&lt;SPAN&gt;SELECTEDVALUE&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;ProviderInfo[SFF]&lt;/SPAN&gt;&lt;SPAN&gt;)&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;var&lt;/SPAN&gt; &lt;SPAN&gt;green&lt;/SPAN&gt;&lt;SPAN&gt; = &lt;/SPAN&gt;&lt;SPAN&gt;SELECTEDVALUE&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;PIPastMonth1[Special Focus Status]&lt;/SPAN&gt;&lt;SPAN&gt;)&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;return&lt;/SPAN&gt; &lt;SPAN&gt;if&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;OR&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;blue&lt;/SPAN&gt;&lt;SPAN&gt; = &amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;or&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;"SFF"&lt;/SPAN&gt;&lt;SPAN&gt;, &lt;/SPAN&gt;&lt;SPAN&gt;"SFF Candidate"&lt;/SPAN&gt;&lt;SPAN&gt;), (&lt;/SPAN&gt;&lt;SPAN&gt;green&lt;/SPAN&gt;&lt;SPAN&gt; = &lt;/SPAN&gt;&lt;SPAN&gt;or&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;"SFF"&lt;/SPAN&gt;&lt;SPAN&gt;, &lt;/SPAN&gt;&lt;SPAN&gt;"SFF Candidate"&lt;/SPAN&gt;&lt;SPAN&gt;))), &lt;/SPAN&gt;&lt;SPAN&gt;"True"&lt;/SPAN&gt;&lt;SPAN&gt;, &lt;/SPAN&gt;&lt;SPAN&gt;"False"&lt;/SPAN&gt;&lt;SPAN&gt;)&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/DIV&gt;</description>
      <pubDate>Mon, 16 Oct 2023 17:19:19 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Developer/If-dax-with-columns/m-p/3479448#M44951</guid>
      <dc:creator>22LACMT</dc:creator>
      <dc:date>2023-10-16T17:19:19Z</dc:date>
    </item>
    <item>
      <title>Re: If dax with columns</title>
      <link>https://community.fabric.microsoft.com/t5/Developer/If-dax-with-columns/m-p/3479491#M44953</link>
      <description>&lt;P&gt;&lt;a href="https://community.fabric.microsoft.com/t5/user/viewprofilepage/user-id/459751"&gt;@22LACMT&lt;/a&gt;&amp;nbsp;I *think* you want this:&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;var blue = SELECTEDVALUE(ProviderInfo[SFF])
var green = SELECTEDVALUE(PIPastMonth1[Special Focus Status])
return 
  if( blue = "SFF" || blue = "SFF Candidate" || green = "SFF" || green = "SFF Candidate", "True", "False")&lt;/LI-CODE&gt;</description>
      <pubDate>Mon, 16 Oct 2023 18:20:18 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Developer/If-dax-with-columns/m-p/3479491#M44953</guid>
      <dc:creator>Greg_Deckler</dc:creator>
      <dc:date>2023-10-16T18:20:18Z</dc:date>
    </item>
    <item>
      <title>Re: If dax with columns</title>
      <link>https://community.fabric.microsoft.com/t5/Developer/If-dax-with-columns/m-p/3479620#M44955</link>
      <description>&lt;P&gt;thank you, can I ask what || mean&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 16 Oct 2023 19:47:57 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Developer/If-dax-with-columns/m-p/3479620#M44955</guid>
      <dc:creator>22LACMT</dc:creator>
      <dc:date>2023-10-16T19:47:57Z</dc:date>
    </item>
    <item>
      <title>Re: If dax with columns</title>
      <link>https://community.fabric.microsoft.com/t5/Developer/If-dax-with-columns/m-p/3479707#M44956</link>
      <description>&lt;P&gt;Im missing something there should be 12 records and there are none marked as true&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 16 Oct 2023 20:53:11 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Developer/If-dax-with-columns/m-p/3479707#M44956</guid>
      <dc:creator>22LACMT</dc:creator>
      <dc:date>2023-10-16T20:53:11Z</dc:date>
    </item>
    <item>
      <title>Re: If dax with columns</title>
      <link>https://community.fabric.microsoft.com/t5/Developer/If-dax-with-columns/m-p/3481129#M44965</link>
      <description>&lt;P&gt;Hi,&amp;nbsp;&lt;/P&gt;&lt;P&gt;everything is showing as false and their should be 12 true.&amp;nbsp; do you think it is the selected value.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 17 Oct 2023 13:10:36 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Developer/If-dax-with-columns/m-p/3481129#M44965</guid>
      <dc:creator>22LACMT</dc:creator>
      <dc:date>2023-10-17T13:10:36Z</dc:date>
    </item>
    <item>
      <title>Re: If dax with columns</title>
      <link>https://community.fabric.microsoft.com/t5/Developer/If-dax-with-columns/m-p/3482420#M44978</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.fabric.microsoft.com/t5/user/viewprofilepage/user-id/459751"&gt;@22LACMT&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;As far as I know,"||" should be OR function in Dax. Grey's code should work and please check your data model.&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="vrzhoumsft_0-1697608062316.png" style="width: 400px;"&gt;&lt;img src="https://community.fabric.microsoft.com/t5/image/serverpage/image-id/982509iF8B9DE046F0CD729/image-size/medium?v=v2&amp;amp;px=400" role="button" title="vrzhoumsft_0-1697608062316.png" alt="vrzhoumsft_0-1697608062316.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;Also you can update your code as below.&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;SFFandCCRC_indicator = 
VAR blue =
    SELECTEDVALUE ( ProviderInfo[SFF] )
VAR green =
    SELECTEDVALUE ( PIPastMonth1[Special Focus Status] )
RETURN
    IF (
        OR ( blue IN { "SFF", "SFF Candidate" }, green IN { "SFF", "SFF Candidate" } ),
        "True",
        "False"
    )&lt;/LI-CODE&gt;
&lt;P&gt;You can download my sample file to learn more details.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Best Regards,&lt;BR /&gt;Rico Zhou&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 18 Oct 2023 05:48:17 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Developer/If-dax-with-columns/m-p/3482420#M44978</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2023-10-18T05:48:17Z</dc:date>
    </item>
  </channel>
</rss>

