<?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 Data Validation with if statement in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Data-Validation-with-if-statement/m-p/2110946#M48275</link>
    <description>&lt;P&gt;Hi all,&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;In my table there column with Regions and column with countries.&lt;/P&gt;&lt;P&gt;I'm looking for a way to validate if countries match to the region as often we are getting data where for example region is India but country Vietnam.&amp;nbsp;&lt;/P&gt;&lt;P&gt;added a custom column with if statement and it works for one region but when I'm trying to add more I'm getting right output (Great/Not so great) for first region but error for the rest.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I wrote something like that&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;if[EMPLOYING_REGION_COMBINED] = "India" and [EMPLOYING_COUNTRY] = "India" then "Great"&lt;BR /&gt;else if [EMPLOYING_REGION_COMBINED] = "Americas" and [EMPLOYING_COUNTRY] = "Argentina" or "Brazil" or "Canada" or "Chile" or "Colombia" or "Mexico" or "United States" then "Great"&lt;BR /&gt;else if [EMPLOYING_REGION_COMBINED] = "Poland" and [EMPLOYING_COUNTRY] = "Poland" then "Great"&lt;BR /&gt;else if [EMPLOYING_REGION_COMBINED] = "Vietnam" and [EMPLOYING_COUNTRY] = "Vietnam" then "Great"&lt;/P&gt;&lt;P&gt;else "Not so Great"&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;my table looks like&lt;/P&gt;&lt;P&gt;Region&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;Country&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;Expected Output&amp;nbsp; &amp;nbsp; what I'm getting&lt;/P&gt;&lt;P&gt;India&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;India&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Great&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;Great&amp;nbsp;&lt;/P&gt;&lt;P&gt;India&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;Vietnam&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;Not so great&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Error&lt;/P&gt;&lt;P&gt;Americas&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;Chile&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Great&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Error&lt;/P&gt;&lt;P&gt;Americas&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;Mexico&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;Great&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Error&lt;/P&gt;&lt;P&gt;Poland&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;Poland&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;Great&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Error&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you all in advance&lt;/P&gt;&lt;P&gt;Marcin&lt;/P&gt;</description>
    <pubDate>Fri, 01 Oct 2021 14:52:33 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2021-10-01T14:52:33Z</dc:date>
    <item>
      <title>Data Validation with if statement</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Data-Validation-with-if-statement/m-p/2110946#M48275</link>
      <description>&lt;P&gt;Hi all,&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;In my table there column with Regions and column with countries.&lt;/P&gt;&lt;P&gt;I'm looking for a way to validate if countries match to the region as often we are getting data where for example region is India but country Vietnam.&amp;nbsp;&lt;/P&gt;&lt;P&gt;added a custom column with if statement and it works for one region but when I'm trying to add more I'm getting right output (Great/Not so great) for first region but error for the rest.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I wrote something like that&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;if[EMPLOYING_REGION_COMBINED] = "India" and [EMPLOYING_COUNTRY] = "India" then "Great"&lt;BR /&gt;else if [EMPLOYING_REGION_COMBINED] = "Americas" and [EMPLOYING_COUNTRY] = "Argentina" or "Brazil" or "Canada" or "Chile" or "Colombia" or "Mexico" or "United States" then "Great"&lt;BR /&gt;else if [EMPLOYING_REGION_COMBINED] = "Poland" and [EMPLOYING_COUNTRY] = "Poland" then "Great"&lt;BR /&gt;else if [EMPLOYING_REGION_COMBINED] = "Vietnam" and [EMPLOYING_COUNTRY] = "Vietnam" then "Great"&lt;/P&gt;&lt;P&gt;else "Not so Great"&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;my table looks like&lt;/P&gt;&lt;P&gt;Region&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;Country&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;Expected Output&amp;nbsp; &amp;nbsp; what I'm getting&lt;/P&gt;&lt;P&gt;India&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;India&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Great&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;Great&amp;nbsp;&lt;/P&gt;&lt;P&gt;India&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;Vietnam&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;Not so great&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Error&lt;/P&gt;&lt;P&gt;Americas&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;Chile&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Great&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Error&lt;/P&gt;&lt;P&gt;Americas&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;Mexico&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;Great&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Error&lt;/P&gt;&lt;P&gt;Poland&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;Poland&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;Great&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Error&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you all in advance&lt;/P&gt;&lt;P&gt;Marcin&lt;/P&gt;</description>
      <pubDate>Fri, 01 Oct 2021 14:52:33 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Data-Validation-with-if-statement/m-p/2110946#M48275</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2021-10-01T14:52:33Z</dc:date>
    </item>
    <item>
      <title>Re: Data Validation with if statement</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Data-Validation-with-if-statement/m-p/2111040#M48278</link>
      <description>&lt;P&gt;Hi&amp;nbsp;Anonymous&lt;/LI-USER&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;That looks like M code from Power Query, correct?&lt;/P&gt;&lt;P&gt;The issue is the list of or values.&amp;nbsp; You need to respecify the column name each time.&lt;/P&gt;&lt;P&gt;So...&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;if [EMPLOYING_REGION_COMBINED] = "India" and [EMPLOYING_COUNTRY] = "India" then "Great"
else if [EMPLOYING_REGION_COMBINED] = "Americas" and ([EMPLOYING_COUNTRY] = "Argentina" or [EMPLOYING_COUNTRY] = "Brazil" or [EMPLOYING_COUNTRY] = "Canada" or [EMPLOYING_COUNTRY] = "Chile" or [EMPLOYING_COUNTRY] = "Colombia" or [EMPLOYING_COUNTRY] = "Mexico" or [EMPLOYING_COUNTRY] = "United States") then "Great"
else if [EMPLOYING_REGION_COMBINED] = "Poland" and [EMPLOYING_COUNTRY] = "Poland" then "Great"
else if [EMPLOYING_REGION_COMBINED] = "Vietnam" and [EMPLOYING_COUNTRY] = "Vietnam" then "Great"

else "Not so Great"&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 01 Oct 2021 15:31:24 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Data-Validation-with-if-statement/m-p/2111040#M48278</guid>
      <dc:creator>PaulOlding</dc:creator>
      <dc:date>2021-10-01T15:31:24Z</dc:date>
    </item>
    <item>
      <title>Re: Data Validation with if statement</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Data-Validation-with-if-statement/m-p/2113546#M48392</link>
      <description>&lt;P&gt;Hi Paul,&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you very much.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 04 Oct 2021 10:26:03 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Data-Validation-with-if-statement/m-p/2113546#M48392</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2021-10-04T10:26:03Z</dc:date>
    </item>
  </channel>
</rss>

