<?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 Return the values from a column that satisfy the conditions based on another columns in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Return-the-values-from-a-column-that-satisfy-the-conditions/m-p/1783030#M37426</link>
    <description>&lt;P&gt;Let's say that I have a table which contains 4 columns - participant name, fiscalyear, email, shareinfo. I want to display the email of only those participants who want to share their info and fiscalyear equal to current year.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I can do it easily in sql using case statement -&amp;nbsp;CASE WHEN (shareinfo=1 and FiscalYear = YEAR(GETDATE())) THEN email END AS Email.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I tried using similar approach in powerbi using "if" statement but it is giving me error - "DAX comparison operations do not support comparing values of type True/False with values of type Text. Consider using the VALUE or FORMAT function to convert one of the values."&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm writing this query -&amp;nbsp;&lt;SPAN&gt;if(Query1[shareinfo]=true() &amp;amp; Query1[FiscalYear]=YEAR(TODAY()),Query1[email],"null")&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Is there any other to achieve the desired result?&lt;/SPAN&gt;&lt;/P&gt;</description>
    <pubDate>Tue, 13 Apr 2021 22:46:24 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2021-04-13T22:46:24Z</dc:date>
    <item>
      <title>Return the values from a column that satisfy the conditions based on another columns</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Return-the-values-from-a-column-that-satisfy-the-conditions/m-p/1783030#M37426</link>
      <description>&lt;P&gt;Let's say that I have a table which contains 4 columns - participant name, fiscalyear, email, shareinfo. I want to display the email of only those participants who want to share their info and fiscalyear equal to current year.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I can do it easily in sql using case statement -&amp;nbsp;CASE WHEN (shareinfo=1 and FiscalYear = YEAR(GETDATE())) THEN email END AS Email.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I tried using similar approach in powerbi using "if" statement but it is giving me error - "DAX comparison operations do not support comparing values of type True/False with values of type Text. Consider using the VALUE or FORMAT function to convert one of the values."&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm writing this query -&amp;nbsp;&lt;SPAN&gt;if(Query1[shareinfo]=true() &amp;amp; Query1[FiscalYear]=YEAR(TODAY()),Query1[email],"null")&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Is there any other to achieve the desired result?&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 13 Apr 2021 22:46:24 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Return-the-values-from-a-column-that-satisfy-the-conditions/m-p/1783030#M37426</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2021-04-13T22:46:24Z</dc:date>
    </item>
    <item>
      <title>Re: Return the values from a column that satisfy the conditions based on another columns</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Return-the-values-from-a-column-that-satisfy-the-conditions/m-p/1783517#M37436</link>
      <description>&lt;P&gt;Hi,&amp;nbsp;Anonymous&lt;/LI-USER&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Please correct me if I wrongly understood your question.&lt;/P&gt;&lt;P&gt;Please try the below.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;EM&gt;query =&lt;/EM&gt;&lt;/STRONG&gt;&lt;BR /&gt;&lt;EM&gt;IF (&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;Query1[shareinfo] = TRUE ()&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;&amp;amp;&amp;amp; Query1[FiscalYear] = YEAR ( TODAY () ),&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;Query1[email],&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;"null"&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;)&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT face="”calibri" color="”#0000FF”"&gt;&lt;EM&gt;&lt;STRONG&gt;Hi, My name is Jihwan Kim. &lt;/STRONG&gt;&lt;/EM&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="”calibri" color="”#0000FF”"&gt;&lt;EM&gt;&lt;STRONG&gt;If this post helps, then please consider accept it as the solution to help other members find it faster, and give a big thumbs up.&lt;BR /&gt;&lt;BR /&gt;Linkedin: &lt;A href="https://www.linkedin.com/in/jihwankim1975/" target="_blank"&gt;https://www.linkedin.com/in/jihwankim1975/&lt;/A&gt;&lt;/STRONG&gt;&lt;/EM&gt;&lt;/FONT&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 14 Apr 2021 03:05:46 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Return-the-values-from-a-column-that-satisfy-the-conditions/m-p/1783517#M37436</guid>
      <dc:creator>Jihwan_Kim</dc:creator>
      <dc:date>2021-04-14T03:05:46Z</dc:date>
    </item>
    <item>
      <title>Re: Return the values from a column that satisfy the conditions based on another columns</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Return-the-values-from-a-column-that-satisfy-the-conditions/m-p/1783594#M37440</link>
      <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="291628" data-lia-user-login="Jihwan_Kim" class="lia-mention lia-mention-user"&gt;Jihwan_Kim&lt;/a&gt;&amp;nbsp;Thank you for your response! This doesn't seem to work since shareinfo and fiscalyear are of different data types. Shareinfo is of true/false data type and fiscalyear of whole number. I tried creating new columns by converting these two columns into text data type, but it still gives me the same error - "&lt;SPAN&gt;DAX comparison operations do not support comparing values of type True/False with values of type Text. Consider using the VALUE or FORMAT function to convert one of the values&lt;/SPAN&gt;"&lt;/P&gt;</description>
      <pubDate>Wed, 14 Apr 2021 03:39:42 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Return-the-values-from-a-column-that-satisfy-the-conditions/m-p/1783594#M37440</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2021-04-14T03:39:42Z</dc:date>
    </item>
  </channel>
</rss>

