<?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: Count the employees who achieved the target in all months in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Count-the-employees-who-achieved-the-target-in-all-months/m-p/3867419#M151082</link>
    <description>&lt;P&gt;Please try this :&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Q1 Passing product test =&lt;BR /&gt;VAR TargetMonths = {"January", "February", "March"}&lt;BR /&gt;RETURN&lt;BR /&gt;COUNTROWS(&lt;BR /&gt;FILTER(&lt;BR /&gt;SUMMARIZE(&lt;BR /&gt;data,&lt;BR /&gt;data[Employee Name],&lt;BR /&gt;"AchievedMonths",&lt;BR /&gt;COUNTROWS(&lt;BR /&gt;FILTER(&lt;BR /&gt;ALL(TargetMonths),&lt;BR /&gt;data[Month] IN TargetMonths &amp;amp;&amp;amp;&lt;BR /&gt;data[Product achievement %] &amp;gt;= 1 &amp;amp;&amp;amp;&lt;BR /&gt;data[Service achievement %] &amp;gt;= 1&lt;BR /&gt;)&lt;BR /&gt;)&lt;BR /&gt;),&lt;BR /&gt;[AchievedMonths] = 3&lt;BR /&gt;)&lt;BR /&gt;)&lt;/P&gt;</description>
    <pubDate>Thu, 25 Apr 2024 06:54:54 GMT</pubDate>
    <dc:creator>123abc</dc:creator>
    <dc:date>2024-04-25T06:54:54Z</dc:date>
    <item>
      <title>Count the employees who achieved the target in all months</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Count-the-employees-who-achieved-the-target-in-all-months/m-p/3867284#M151068</link>
      <description>&lt;P&gt;Hi,&lt;BR /&gt;I have this mesure to get the sales employees who achive the target in th 1st quarter.&lt;BR /&gt;I want only the people who achieved the target in all months. so if an meployee achieved the target in Jan only, or Jan &amp;amp; March, then it will not be counted .&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;The below meausre will give the result in image 1, where 5 employees only got 3 so they achevied the target in each month.&lt;/P&gt;&lt;P&gt;However, as soon as I add the emplyee name to teh table as in image 2, I will get only 2 employees which is wrong.&lt;BR /&gt;So, I wonder what is wrong and how to fix it to get the 5 employees at the end with tehir details.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;Q1 Passing product test =&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &lt;/SPAN&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; &amp;nbsp; &amp;nbsp; &lt;/SPAN&gt;&lt;SPAN&gt;COUNT&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;data&lt;/SPAN&gt;&lt;SPAN&gt;[ID#]&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;FILTER&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; &amp;nbsp; &amp;nbsp; &lt;/SPAN&gt;&lt;SPAN&gt;data&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; &amp;nbsp; &amp;nbsp; &lt;/SPAN&gt;&lt;SPAN&gt;data&lt;/SPAN&gt;&lt;SPAN&gt;[Product achievement %]&lt;/SPAN&gt;&lt;SPAN&gt; &amp;gt;= &lt;/SPAN&gt;&lt;SPAN&gt;1&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; &amp;nbsp; &amp;nbsp; &lt;/SPAN&gt;&lt;SPAN&gt;data&lt;/SPAN&gt;&lt;SPAN&gt;[Service achievement %]&lt;/SPAN&gt;&lt;SPAN&gt; &amp;gt;= &lt;/SPAN&gt;&lt;SPAN&gt;1&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;amp;&amp;amp;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/SPAN&gt;&lt;SPAN&gt;data&lt;/SPAN&gt;&lt;SPAN&gt;[Month]&lt;/SPAN&gt; &lt;SPAN&gt;IN&lt;/SPAN&gt;&lt;SPAN&gt; {&lt;/SPAN&gt;&lt;SPAN&gt;"January"&lt;/SPAN&gt;&lt;SPAN&gt;, &lt;/SPAN&gt;&lt;SPAN&gt;"February"&lt;/SPAN&gt;&lt;SPAN&gt;, &lt;/SPAN&gt;&lt;SPAN&gt;"March"&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; &amp;nbsp; &amp;nbsp; &lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; )&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; )&lt;BR /&gt;&lt;BR /&gt;image 1&lt;BR /&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;img /&gt;&lt;P&gt;image 2&lt;/P&gt;&lt;img /&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;/DIV&gt;&lt;/DIV&gt;</description>
      <pubDate>Thu, 25 Apr 2024 06:14:10 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Count-the-employees-who-achieved-the-target-in-all-months/m-p/3867284#M151068</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2024-04-25T06:14:10Z</dc:date>
    </item>
    <item>
      <title>Re: Count the employees who achieved the target in all months</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Count-the-employees-who-achieved-the-target-in-all-months/m-p/3867373#M151078</link>
      <description>&lt;P&gt;To achieve this in Power BI DAX, you need to count the employees who achieved the target in all three months of the first quarter. You can modify your DAX measure to achieve this.&lt;/P&gt;&lt;P&gt;Here's how you can do it:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Q1 Passing product test =&lt;BR /&gt;VAR TotalMonths = 3 -- Total number of months in the quarter&lt;BR /&gt;RETURN&lt;BR /&gt;COUNTROWS(&lt;BR /&gt;FILTER(&lt;BR /&gt;SUMMARIZE(&lt;BR /&gt;data,&lt;BR /&gt;data[Employee Name],&lt;BR /&gt;"AchievedMonths", COUNTAX(&lt;BR /&gt;FILTER(&lt;BR /&gt;ALL(data),&lt;BR /&gt;data[Product achievement %] &amp;gt;= 1 &amp;amp;&amp;amp; data[Service achievement %] &amp;gt;= 1&lt;BR /&gt;),&lt;BR /&gt;data[Month]&lt;BR /&gt;)&lt;BR /&gt;),&lt;BR /&gt;[AchievedMonths] = TotalMonths&lt;BR /&gt;)&lt;BR /&gt;)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Explanation of the DAX measure:&lt;/P&gt;&lt;OL&gt;&lt;LI&gt;SUMMARIZE is used to get a table with distinct employee names and the number of months they achieved the target.&lt;/LI&gt;&lt;LI&gt;FILTER is used to filter out the employees who achieved the target in all three months.&lt;/LI&gt;&lt;LI&gt;COUNTROWS counts the number of employees who achieved the target in all three months.&lt;/LI&gt;&lt;/OL&gt;&lt;P&gt;This measure should give you the correct count of employees who achieved the target in all three months of the first quarter.&lt;/P&gt;&lt;P&gt;Here's the modified DAX measure for your reference:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Q1 Passing product test =&lt;BR /&gt;VAR TotalMonths = 3 -- Total number of months in the quarter&lt;BR /&gt;RETURN&lt;BR /&gt;COUNTROWS(&lt;BR /&gt;FILTER(&lt;BR /&gt;SUMMARIZE(&lt;BR /&gt;data,&lt;BR /&gt;data[Employee Name],&lt;BR /&gt;"AchievedMonths", COUNTAX(&lt;BR /&gt;FILTER(&lt;BR /&gt;ALL(data),&lt;BR /&gt;data[Product achievement %] &amp;gt;= 1 &amp;amp;&amp;amp; data[Service achievement %] &amp;gt;= 1&lt;BR /&gt;),&lt;BR /&gt;data[Month]&lt;BR /&gt;)&lt;BR /&gt;),&lt;BR /&gt;[AchievedMonths] = TotalMonths&lt;BR /&gt;)&lt;BR /&gt;)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Replace data[Employee Name] with the actual column name for the employee names in your dataset.&lt;/P&gt;&lt;P&gt;This modified measure should give you the correct count of employees who achieved the target in all three months of the first quarter, even when you add the employee names to the table.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;If this post&amp;nbsp;helps, then please consider&amp;nbsp;Accepting it as the solution&amp;nbsp;to help the other members find it more quickly.&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;nbsp;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;In case there is still a problem, please feel free and explain your issue in detail,&amp;nbsp;It will be my pleasure to assist you in any way I can.&lt;/STRONG&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 25 Apr 2024 06:41:38 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Count-the-employees-who-achieved-the-target-in-all-months/m-p/3867373#M151078</guid>
      <dc:creator>123abc</dc:creator>
      <dc:date>2024-04-25T06:41:38Z</dc:date>
    </item>
    <item>
      <title>Re: Count the employees who achieved the target in all months</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Count-the-employees-who-achieved-the-target-in-all-months/m-p/3867406#M151080</link>
      <description>&lt;P&gt;Thank but this give no result at all.&lt;/P&gt;</description>
      <pubDate>Thu, 25 Apr 2024 06:51:02 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Count-the-employees-who-achieved-the-target-in-all-months/m-p/3867406#M151080</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2024-04-25T06:51:02Z</dc:date>
    </item>
    <item>
      <title>Re: Count the employees who achieved the target in all months</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Count-the-employees-who-achieved-the-target-in-all-months/m-p/3867419#M151082</link>
      <description>&lt;P&gt;Please try this :&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Q1 Passing product test =&lt;BR /&gt;VAR TargetMonths = {"January", "February", "March"}&lt;BR /&gt;RETURN&lt;BR /&gt;COUNTROWS(&lt;BR /&gt;FILTER(&lt;BR /&gt;SUMMARIZE(&lt;BR /&gt;data,&lt;BR /&gt;data[Employee Name],&lt;BR /&gt;"AchievedMonths",&lt;BR /&gt;COUNTROWS(&lt;BR /&gt;FILTER(&lt;BR /&gt;ALL(TargetMonths),&lt;BR /&gt;data[Month] IN TargetMonths &amp;amp;&amp;amp;&lt;BR /&gt;data[Product achievement %] &amp;gt;= 1 &amp;amp;&amp;amp;&lt;BR /&gt;data[Service achievement %] &amp;gt;= 1&lt;BR /&gt;)&lt;BR /&gt;)&lt;BR /&gt;),&lt;BR /&gt;[AchievedMonths] = 3&lt;BR /&gt;)&lt;BR /&gt;)&lt;/P&gt;</description>
      <pubDate>Thu, 25 Apr 2024 06:54:54 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Count-the-employees-who-achieved-the-target-in-all-months/m-p/3867419#M151082</guid>
      <dc:creator>123abc</dc:creator>
      <dc:date>2024-04-25T06:54:54Z</dc:date>
    </item>
    <item>
      <title>Re: Count the employees who achieved the target in all months</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Count-the-employees-who-achieved-the-target-in-all-months/m-p/3867445#M151085</link>
      <description>&lt;P&gt;This is another solution ... please try this :&lt;/P&gt;&lt;P&gt;Here’s a step-by-step guide to solve this with DAX in Power BI:&lt;/P&gt;&lt;OL&gt;&lt;LI&gt;&lt;P&gt;&lt;STRONG&gt;Define the Target Months&lt;/STRONG&gt;: You’ve already defined the target months correctly.&lt;/P&gt;&lt;DIV class=""&gt;&lt;PRE&gt;VAR TargetMonths = {"January", "February", "March"}&lt;/PRE&gt;&lt;/DIV&gt;&lt;/LI&gt;&lt;LI&gt;&lt;P&gt;&lt;STRONG&gt;Create a Calculated Column&lt;/STRONG&gt;: You’ll need to create a calculated column in your data table to check if each row corresponds to one of the target months and has achieved the required percentages.&lt;/P&gt;&lt;DIV class=""&gt;&lt;PRE&gt;Achieved = 
IF(
    data[Month] IN TargetMonths &amp;amp;&amp;amp; 
    data[Product achievement %] &amp;gt;= 1 &amp;amp;&amp;amp; 
    data[Service achievement %] &amp;gt;= 1,
    1,
    0
)&lt;/PRE&gt;&lt;/DIV&gt;&lt;/LI&gt;&lt;LI&gt;&lt;P&gt;&lt;STRONG&gt;Summarize the Data&lt;/STRONG&gt;: Use the&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;SUMMARIZE&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;function to group the data by employee and count the number of achieved months.&lt;/P&gt;&lt;DIV class=""&gt;&lt;PRE&gt;EmployeeAchievements = 
SUMMARIZE(
    data,
    data[Employee Name],
    "AchievedMonths", 
    SUM(data[Achieved])
)&lt;/PRE&gt;&lt;/DIV&gt;&lt;/LI&gt;&lt;LI&gt;&lt;P&gt;&lt;STRONG&gt;Filter the Summary&lt;/STRONG&gt;: Now, filter this summarized table to only include employees who have achieved the target in all three months.&lt;/P&gt;&lt;DIV class=""&gt;&lt;PRE&gt;QualifiedEmployees = 
FILTER(
    EmployeeAchievements,
    [AchievedMonths] = 3
)&lt;/PRE&gt;&lt;/DIV&gt;&lt;/LI&gt;&lt;LI&gt;&lt;P&gt;&lt;STRONG&gt;Count the Rows&lt;/STRONG&gt;: Finally, count the number of rows in the filtered table to get the number of employees who passed the product test.&lt;/P&gt;&lt;DIV class=""&gt;&lt;PRE&gt;PassingProductTest = 
COUNTROWS(QualifiedEmployees)&lt;/PRE&gt;&lt;/DIV&gt;&lt;/LI&gt;&lt;LI&gt;&lt;P&gt;&lt;STRONG&gt;Create a Measure&lt;/STRONG&gt;: Combine all the steps above into a single measure that you can use in your reports.&lt;/P&gt;&lt;DIV class=""&gt;&lt;PRE&gt;Passing Product Test = 
VAR TargetMonths = {"January", "February", "March"}
VAR EmployeeAchievements = 
    SUMMARIZE(
        data,
        data[Employee Name],
        "AchievedMonths", 
        SUM(data[Achieved])
    )
VAR QualifiedEmployees = 
    FILTER(
        EmployeeAchievements,
        [AchievedMonths] = 3
    )
RETURN
COUNTROWS(QualifiedEmployees)&lt;/PRE&gt;&lt;/DIV&gt;&lt;/LI&gt;&lt;/OL&gt;&lt;P&gt;This measure will now return the count of employees who have 100% product and service achievement in January, February, and March. Remember to replace&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;data&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;with the actual name of your table in Power BI. Also, ensure that the&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;Product achievement %&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;and&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;Service achievement %&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;are formatted correctly as percentages in the data model.&lt;/P&gt;&lt;P&gt;Let me know if you need further assistance! &lt;span class="lia-unicode-emoji" title=":smiling_face_with_smiling_eyes:"&gt;😊&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 25 Apr 2024 07:01:38 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Count-the-employees-who-achieved-the-target-in-all-months/m-p/3867445#M151085</guid>
      <dc:creator>123abc</dc:creator>
      <dc:date>2024-04-25T07:01:38Z</dc:date>
    </item>
    <item>
      <title>Re: Count the employees who achieved the target in all months</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Count-the-employees-who-achieved-the-target-in-all-months/m-p/3870174#M151179</link>
      <description>&lt;P&gt;Hi&amp;nbsp;Anonymous&lt;/LI-USER&gt;&amp;nbsp;,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;When you add the emplyee name to the table, the emplyee field acts as a filter for the formula. Based on your description, it needs to be grouped by emplyee. Refer to the modified formula below.&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;Q1 Passing product test = 
CALCULATE (
    COUNT ( data[ID#] ),
    FILTER (
        ALL(data),
        data[Product achievement %] &amp;gt;= 1
            &amp;amp;&amp;amp; data[Service achievement %] &amp;gt;= 1
            &amp;amp;&amp;amp; data[Month]
                IN { "January", "February", "March" }
                    &amp;amp;&amp;amp; data[ID#] = MAX ( data[ID#] )
    )
)

&lt;/LI-CODE&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Best Regards,&lt;BR /&gt;Adamk Kong&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If this post&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;EM&gt;&lt;STRONG&gt;helps&lt;/STRONG&gt;&lt;/EM&gt;, then please consider&lt;EM&gt;&lt;STRONG&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;Accept it as the solution&lt;/STRONG&gt;&lt;/EM&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;to help the other members find it more quickly.&lt;/P&gt;</description>
      <pubDate>Fri, 26 Apr 2024 06:35:57 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Count-the-employees-who-achieved-the-target-in-all-months/m-p/3870174#M151179</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2024-04-26T06:35:57Z</dc:date>
    </item>
  </channel>
</rss>

