<?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: Switch(TRUE() and OR function to validate and count entries in columns in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Switch-TRUE-and-OR-function-to-validate-and-count-entries-in/m-p/3367938#M126687</link>
    <description>&lt;P&gt;&lt;FONT face="tahoma,arial,helvetica,sans-serif"&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="588280" data-lia-user-login="anands06" class="lia-mention lia-mention-user"&gt;anands06&lt;/a&gt;,&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="tahoma,arial,helvetica,sans-serif"&gt;I checked you formula and condition and find they can be simplify to following expressions, you can try it if hleps:&lt;/FONT&gt;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;DET(X3_OnTime) =
IF (
    [X3&amp;lt;=AA] &amp;lt;&amp;gt; "DET=Y"
        || [AF&amp;gt;(AA+2)] &amp;lt;&amp;gt; "DET=Y",
    "NoEvent",
    "DET(X3_OnTime)=Y"
)&lt;/LI-CODE&gt;
&lt;P&gt;&lt;FONT face="tahoma,arial,helvetica,sans-serif"&gt;Comment:&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="tahoma,arial,helvetica,sans-serif"&gt;If statement to get reverse of the first condition to check if these two column not equal to "DET=Y" with OR logic. If they not match sceniaros means both two column&amp;nbsp;equal to "DET=Y" and they match wiht your second condition. &lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="tahoma,arial,helvetica,sans-serif"&gt;Regards,&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="tahoma,arial,helvetica,sans-serif"&gt;Xiaoxin Sheng&lt;/FONT&gt;&lt;/P&gt;</description>
    <pubDate>Mon, 07 Aug 2023 08:34:22 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2023-08-07T08:34:22Z</dc:date>
    <item>
      <title>Switch(TRUE() and OR function to validate and count entries in columns</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Switch-TRUE-and-OR-function-to-validate-and-count-entries-in/m-p/3363664#M126466</link>
      <description>&lt;P&gt;Hello Friends,&lt;/P&gt;&lt;P&gt;Need your advise if I can use&lt;STRONG&gt; SWITCH(TRUE()&lt;/STRONG&gt; and&lt;STRONG&gt; ||&lt;/STRONG&gt; function like below:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;In power pivot I have 2 columns named as&lt;BR /&gt;[&lt;STRONG&gt;X3&amp;lt;=AA&lt;/STRONG&gt;], [&lt;STRONG&gt;AF&amp;gt;(AA+2)&lt;/STRONG&gt;]. Then column [&lt;STRONG&gt;X3&amp;lt;=AA&lt;/STRONG&gt;] has following values "&lt;EM&gt;NoAACarr&lt;/EM&gt;","&lt;EM&gt;NoX3Carr&lt;/EM&gt;", "&lt;EM&gt;DET=Y&lt;/EM&gt;" and column [&lt;STRONG&gt;AF&amp;gt;(AA+2)&lt;/STRONG&gt;] has following values "&lt;EM&gt;NoAFCarr&lt;/EM&gt;", "&lt;EM&gt;DET=Y&lt;/EM&gt;"&lt;/P&gt;&lt;P&gt;I want to first check if all the three columns has one these values in their field&amp;nbsp;"&lt;EM&gt;NoAACarr&lt;/EM&gt;","&lt;EM&gt;NoX3Carr&lt;/EM&gt;","&lt;EM&gt;NoAFCarr&lt;/EM&gt;", I apply &lt;STRONG&gt;OR (||)&lt;/STRONG&gt; function if not then filter the 2 columns where it has&amp;nbsp;"&lt;EM&gt;DET=Y"&lt;/EM&gt;.&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;is the below correct DAX formula&lt;/P&gt;&lt;P&gt;DET(X3_OnTime):=SWITCH(TRUE(),&lt;/P&gt;&lt;P&gt;[X3&amp;lt;=AA]="NoAACarr" || [X3&amp;lt;=AA]="NoX3Carr" || [AF&amp;gt;(AA+2)]="NoAFCarr" ,"NoEvent",&amp;nbsp;&lt;BR /&gt;[X3&amp;lt;=AA] = "DET=Y" &amp;amp;&amp;amp; [AF&amp;gt;(AA+2)]="DET=Y","DET(X3_OnTime)=Y","DET=N")&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Once i work up the formula data looks like this:&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Best Regards&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 03 Aug 2023 12:24:52 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Switch-TRUE-and-OR-function-to-validate-and-count-entries-in/m-p/3363664#M126466</guid>
      <dc:creator>anands06</dc:creator>
      <dc:date>2023-08-03T12:24:52Z</dc:date>
    </item>
    <item>
      <title>Re: Switch(TRUE() and OR function to validate and count entries in columns</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Switch-TRUE-and-OR-function-to-validate-and-count-entries-in/m-p/3364157#M126486</link>
      <description>&lt;P&gt;Friends,&lt;/P&gt;&lt;P&gt;I worked and validated the data and above formula works well.&lt;/P&gt;</description>
      <pubDate>Thu, 03 Aug 2023 18:18:01 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Switch-TRUE-and-OR-function-to-validate-and-count-entries-in/m-p/3364157#M126486</guid>
      <dc:creator>anands06</dc:creator>
      <dc:date>2023-08-03T18:18:01Z</dc:date>
    </item>
    <item>
      <title>Re: Switch(TRUE() and OR function to validate and count entries in columns</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Switch-TRUE-and-OR-function-to-validate-and-count-entries-in/m-p/3367938#M126687</link>
      <description>&lt;P&gt;&lt;FONT face="tahoma,arial,helvetica,sans-serif"&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="588280" data-lia-user-login="anands06" class="lia-mention lia-mention-user"&gt;anands06&lt;/a&gt;,&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="tahoma,arial,helvetica,sans-serif"&gt;I checked you formula and condition and find they can be simplify to following expressions, you can try it if hleps:&lt;/FONT&gt;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;DET(X3_OnTime) =
IF (
    [X3&amp;lt;=AA] &amp;lt;&amp;gt; "DET=Y"
        || [AF&amp;gt;(AA+2)] &amp;lt;&amp;gt; "DET=Y",
    "NoEvent",
    "DET(X3_OnTime)=Y"
)&lt;/LI-CODE&gt;
&lt;P&gt;&lt;FONT face="tahoma,arial,helvetica,sans-serif"&gt;Comment:&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="tahoma,arial,helvetica,sans-serif"&gt;If statement to get reverse of the first condition to check if these two column not equal to "DET=Y" with OR logic. If they not match sceniaros means both two column&amp;nbsp;equal to "DET=Y" and they match wiht your second condition. &lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="tahoma,arial,helvetica,sans-serif"&gt;Regards,&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="tahoma,arial,helvetica,sans-serif"&gt;Xiaoxin Sheng&lt;/FONT&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 07 Aug 2023 08:34:22 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Switch-TRUE-and-OR-function-to-validate-and-count-entries-in/m-p/3367938#M126687</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2023-08-07T08:34:22Z</dc:date>
    </item>
    <item>
      <title>Re: Switch(TRUE() and OR function to validate and count entries in columns</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Switch-TRUE-and-OR-function-to-validate-and-count-entries-in/m-p/3369608#M126775</link>
      <description>&lt;P&gt;Hello&amp;nbsp;&lt;SPAN&gt;Xiaoxin Sheng,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Thanks for taking out the time and giving valuable advise.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;It works well however I also wanted to add another condition of "DET=N"&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;As per your formula we may miss "DET=N".&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;regards&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Anand&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 08 Aug 2023 06:25:31 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Switch-TRUE-and-OR-function-to-validate-and-count-entries-in/m-p/3369608#M126775</guid>
      <dc:creator>anands06</dc:creator>
      <dc:date>2023-08-08T06:25:31Z</dc:date>
    </item>
    <item>
      <title>Re: Switch(TRUE() and OR function to validate and count entries in columns</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Switch-TRUE-and-OR-function-to-validate-and-count-entries-in/m-p/3371688#M126886</link>
      <description>&lt;P&gt;Hello&amp;nbsp;&lt;SPAN&gt;Xiaoxin Sheng,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Thanks for taking out the time and giving valuable advise.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;It works well however I also wanted to add another condition of "DET=N"&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;As per your formula we may miss "DET=N". I hope you agree with my response.&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;regards&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Anand&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 09 Aug 2023 07:11:17 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Switch-TRUE-and-OR-function-to-validate-and-count-entries-in/m-p/3371688#M126886</guid>
      <dc:creator>anands06</dc:creator>
      <dc:date>2023-08-09T07:11:17Z</dc:date>
    </item>
    <item>
      <title>Re: Switch(TRUE() and OR function to validate and count entries in columns</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Switch-TRUE-and-OR-function-to-validate-and-count-entries-in/m-p/3375937#M127123</link>
      <description>&lt;P&gt;&lt;FONT face="tahoma,arial,helvetica,sans-serif"&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="588280" data-lia-user-login="anands06" class="lia-mention lia-mention-user"&gt;anands06&lt;/a&gt;,&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="tahoma,arial,helvetica,sans-serif"&gt;You can try to use this one, I add condition to recogined the "DEF=N" flag:&lt;/FONT&gt;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;DET(X3_OnTime) =
IF (
    [X3&amp;lt;=AA] &amp;lt;&amp;gt; "DET=Y"
        || [AF&amp;gt;(AA+2)] &amp;lt;&amp;gt; "DET=Y",
    "NoEvent",
    IF ( [X3&amp;lt;=AA] = [AF&amp;gt;(AA+2)], "DET(X3_OnTime)=Y", "DET=N" )
)&lt;/LI-CODE&gt;
&lt;P&gt;&lt;FONT face="tahoma,arial,helvetica,sans-serif"&gt;Comment:&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="tahoma,arial,helvetica,sans-serif"&gt;First condition check 'No Events' flag, if not match it mean at least one field equal to "DEF=Y". &lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="tahoma,arial,helvetica,sans-serif"&gt;The second condition check if two fields have same value, since the default condition is at least one field equal to "DEF=Y", so it will trigger if two columns equal to "DEF=Y". If both previous two conditions all not matched, the formula will return "DEF=N".&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="tahoma,arial,helvetica,sans-serif"&gt;Regards,&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="tahoma,arial,helvetica,sans-serif"&gt;Xiaoxin Sheng&lt;/FONT&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 11 Aug 2023 08:43:04 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Switch-TRUE-and-OR-function-to-validate-and-count-entries-in/m-p/3375937#M127123</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2023-08-11T08:43:04Z</dc:date>
    </item>
    <item>
      <title>Re: Switch(TRUE() and OR function to validate and count entries in columns</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Switch-TRUE-and-OR-function-to-validate-and-count-entries-in/m-p/3376684#M127159</link>
      <description>&lt;P&gt;Hello&amp;nbsp;&lt;SPAN&gt;Xiaoxin,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;Thanks for your attention. It works perfectly fine.&lt;/P&gt;&lt;P&gt;Both IF and my SWITCH(TRUE() formula show the same result.&amp;nbsp;&lt;/P&gt;&lt;P&gt;Good interaction with you.&lt;/P&gt;&lt;P&gt;best regards&lt;/P&gt;&lt;P&gt;Anand&lt;/P&gt;</description>
      <pubDate>Fri, 11 Aug 2023 16:39:59 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Switch-TRUE-and-OR-function-to-validate-and-count-entries-in/m-p/3376684#M127159</guid>
      <dc:creator>anands06</dc:creator>
      <dc:date>2023-08-11T16:39:59Z</dc:date>
    </item>
  </channel>
</rss>

