<?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: Multiple OR condtions within calculate in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Multiple-OR-condtions-within-calculate/m-p/4361179#M173128</link>
    <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="910290" data-lia-user-login="san_bxl" class="lia-mention lia-mention-user"&gt;san_bxl&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You calculation is based on your data model.&amp;nbsp; We need to know the relationship in your report and what your table looks like.&lt;BR /&gt;Could you share a sample file with us and then show us a screenshot with the result you want? This will make it easier for us to find the solution.&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;</description>
    <pubDate>Mon, 13 Jan 2025 09:13:04 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2025-01-13T09:13:04Z</dc:date>
    <item>
      <title>Multiple OR condtions within calculate</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Multiple-OR-condtions-within-calculate/m-p/4356710#M172961</link>
      <description>&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;I have to write a DAX which filters data from three connected tables.&lt;BR /&gt;table 1. Project Resource Assignemnet&lt;BR /&gt;table 2.Project Resource&lt;BR /&gt;table 3,Project_activity&lt;BR /&gt;&lt;BR /&gt;I need to now get a sum from Resource Assignement&amp;nbsp; and have multiple conditons 1 ,2 and 3&lt;BR /&gt;Between these i need to have OR and Condition 2 and 3 i need a AND within it&lt;BR /&gt;&lt;BR /&gt;M11-&lt;/SPAN&gt;&lt;SPAN&gt;2&lt;/SPAN&gt;&lt;SPAN&gt;a_Scope = &lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;CALCULATE&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &lt;/SPAN&gt;&lt;SPAN&gt;SUM&lt;/SPAN&gt;&lt;SPAN&gt;('Project-Resource Assignment'[PlannedUnits]),&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &lt;/SPAN&gt;&lt;SPAN&gt;ALL&lt;/SPAN&gt;&lt;SPAN&gt;('DATE TABLE'),&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &lt;/SPAN&gt;&lt;SPAN&gt;-- condition 1 &lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; 'Project-Resource'[Id] &lt;/SPAN&gt;&lt;SPAN&gt;IN&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; &lt;/SPAN&gt;&lt;SPAN&gt;"C3-GAD-14"&lt;/SPAN&gt;&lt;SPAN&gt;, &amp;nbsp;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &amp;n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t;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; } || &lt;/SPAN&gt;&lt;/DIV&gt;&lt;BR /&gt;&lt;DIV&gt;&lt;SPAN&gt;-- condition 2 &lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; (&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 'Project-Resource'[Id] = &lt;/SPAN&gt;&lt;SPAN&gt;"C3-M-102"&lt;/SPAN&gt;&lt;SPAN&gt; &amp;amp;&amp;amp; &lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/SPAN&gt;&lt;SPAN&gt;LEFT&lt;/SPAN&gt;&lt;SPAN&gt;('Project-Activity'[Id], &lt;/SPAN&gt;&lt;SPAN&gt;14&lt;/SPAN&gt;&lt;SPAN&gt;) = &lt;/SPAN&gt;&lt;SPAN&gt;"CM-"&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; ) ||&lt;/SPAN&gt;&lt;/DIV&gt;&lt;BR /&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &lt;/SPAN&gt;&lt;SPAN&gt;--&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;-- condition 2 &lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; (&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 'Project-Resource'[Id] = &lt;/SPAN&gt;&lt;SPAN&gt;"C3-M-88"&lt;/SPAN&gt;&lt;SPAN&gt; &amp;amp;&amp;amp; &lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/SPAN&gt;&lt;SPAN&gt;LEFT&lt;/SPAN&gt;&lt;SPAN&gt;('Project-Activity'[Id], &lt;/SPAN&gt;&lt;SPAN&gt;14&lt;/SPAN&gt;&lt;SPAN&gt;) = &lt;/SPAN&gt;&lt;SPAN&gt;"CM-S3"&lt;/SPAN&gt;&lt;SPAN&gt; &amp;nbsp;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; )&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;)&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;## the above code doesnt work&lt;BR /&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/DIV&gt;</description>
      <pubDate>Thu, 09 Jan 2025 08:06:30 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Multiple-OR-condtions-within-calculate/m-p/4356710#M172961</guid>
      <dc:creator>san_bxl</dc:creator>
      <dc:date>2025-01-09T08:06:30Z</dc:date>
    </item>
    <item>
      <title>Re: Multiple OR condtions within calculate</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Multiple-OR-condtions-within-calculate/m-p/4357570#M172987</link>
      <description>&lt;P&gt;In both LEFT functions you are taking 14 characters, I think you meant to only take 4.&lt;/P&gt;</description>
      <pubDate>Thu, 09 Jan 2025 16:46:57 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Multiple-OR-condtions-within-calculate/m-p/4357570#M172987</guid>
      <dc:creator>johnt75</dc:creator>
      <dc:date>2025-01-09T16:46:57Z</dc:date>
    </item>
    <item>
      <title>Re: Multiple OR condtions within calculate</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Multiple-OR-condtions-within-calculate/m-p/4358208#M173013</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="910290" data-lia-user-login="san_bxl" class="lia-mention lia-mention-user"&gt;san_bxl&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Your DAX formula has logical flaws that prevent the CALCULATE function from interpreting the conditions as intended. Specifically, the logical OR (||) and AND (&amp;amp;&amp;amp;) operations must be properly nested, and the filter syntax needs to conform to the DAX filter context structure.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Here’s the corrected DAX formula:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;M11-2a_Scope =
CALCULATE(
    SUM('Project-Resource Assignment'[PlannedUnits]),
    ALL('DATE TABLE'),
    
    // Condition 1
    OR(
        'Project-Resource'[Id] IN {
            "C3-GAD-14",  
            "C3-GAD-12",  
            "C3-GAD-13",  
            "C3-GAD-11",  
            "C3-GAD-2",  
            "C3-GAD-1",  
            "C3-GAD-7",  
            "C3-M-9"
        },

        // Condition 2 AND Condition 3
        AND(
            'Project-Resource'[Id] = "C3-M-102",
            LEFT('Project-Activity'[Id], 14) = "CM-"
        ),

        AND(
            'Project-Resource'[Id] = "C3-M-88",
            LEFT('Project-Activity'[Id], 14) = "CM-S3"
        )
    )
)&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This formula should now calculate the sum of PlannedUnits with the specified conditions applied correctly.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Did I answer your question? Mark my post as a solution, this will help others!&lt;/STRONG&gt;&lt;BR /&gt;If my response(s) assisted you in any way, don't forget to drop me a "&lt;STRONG&gt;Kudos&lt;/STRONG&gt;" &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;&lt;P&gt;Kind Regards,&lt;BR /&gt;Poojara&lt;BR /&gt;Data Analyst | MSBI Developer | Power BI Consultant&lt;BR /&gt;&lt;STRONG&gt;Consider Subscribing my YouTube for Beginners/Advance Concepts:&lt;/STRONG&gt;&amp;nbsp;&lt;A href="https://youtube.com/@biconcepts?si=04iw9SYI2HN80HKS" target="_self"&gt;https://youtube.com/@biconcepts?si=04iw9SYI2HN80HKS&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 10 Jan 2025 05:36:55 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Multiple-OR-condtions-within-calculate/m-p/4358208#M173013</guid>
      <dc:creator>Poojara_D12</dc:creator>
      <dc:date>2025-01-10T05:36:55Z</dc:date>
    </item>
    <item>
      <title>Re: Multiple OR condtions within calculate</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Multiple-OR-condtions-within-calculate/m-p/4358223#M173014</link>
      <description>&lt;P&gt;I am looking for&lt;BR /&gt;condition 1 or Condition 2 or Conditon 3&lt;BR /&gt;If it satisfies any, its should calculate&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 10 Jan 2025 05:54:17 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Multiple-OR-condtions-within-calculate/m-p/4358223#M173014</guid>
      <dc:creator>San_Raz</dc:creator>
      <dc:date>2025-01-10T05:54:17Z</dc:date>
    </item>
    <item>
      <title>Re: Multiple OR condtions within calculate</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Multiple-OR-condtions-within-calculate/m-p/4358234#M173016</link>
      <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="699988" data-lia-user-login="San_Raz" class="lia-mention lia-mention-user"&gt;San_Raz&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Can you try this dax:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;M11-2a_Scope =
CALCULATE(
    SUM('Project-Resource Assignment'[PlannedUnits]),
    ALL('DATE TABLE'),
    
    // Combine Condition 1, 2, and 3 with OR logic
    OR(
        // Condition 1
        'Project-Resource'[Id] IN {
            "C3-GAD-14",  
            "C3-GAD-12",  
            "C3-GAD-13",  
            "C3-GAD-11",  
            "C3-GAD-2",  
            "C3-GAD-1",  
            "C3-GAD-7",  
            "C3-M-9"
        },

        // Condition 2
        AND(
            'Project-Resource'[Id] = "C3-M-102",
            LEFT('Project-Activity'[Id], 14) = "CM-"
        ),

        // Condition 3
        AND(
            'Project-Resource'[Id] = "C3-M-88",
            LEFT('Project-Activity'[Id], 14) = "CM-S3"
        )
    )
)&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Did I answer your question? Mark my post as a solution, this will help others!&lt;/STRONG&gt;&lt;BR /&gt;If my response(s) assisted you in any way, don't forget to drop me a "&lt;STRONG&gt;Kudos&lt;/STRONG&gt;" &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;&lt;P&gt;Kind Regards,&lt;BR /&gt;Poojara&lt;BR /&gt;Data Analyst | MSBI Developer | Power BI Consultant&lt;BR /&gt;&lt;STRONG&gt;Consider Subscribing my YouTube for Beginners/Advance Concepts:&lt;/STRONG&gt;&amp;nbsp;&lt;A href="https://youtube.com/@biconcepts?si=04iw9SYI2HN80HKS" target="_self"&gt;https://youtube.com/@biconcepts?si=04iw9SYI2HN80HKS&lt;/A&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 10 Jan 2025 06:04:16 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Multiple-OR-condtions-within-calculate/m-p/4358234#M173016</guid>
      <dc:creator>Poojara_D12</dc:creator>
      <dc:date>2025-01-10T06:04:16Z</dc:date>
    </item>
    <item>
      <title>Re: Multiple OR condtions within calculate</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Multiple-OR-condtions-within-calculate/m-p/4361179#M173128</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="910290" data-lia-user-login="san_bxl" class="lia-mention lia-mention-user"&gt;san_bxl&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You calculation is based on your data model.&amp;nbsp; We need to know the relationship in your report and what your table looks like.&lt;BR /&gt;Could you share a sample file with us and then show us a screenshot with the result you want? This will make it easier for us to find the solution.&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;</description>
      <pubDate>Mon, 13 Jan 2025 09:13:04 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Multiple-OR-condtions-within-calculate/m-p/4361179#M173128</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2025-01-13T09:13:04Z</dc:date>
    </item>
  </channel>
</rss>

