<?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 latest plan by each status in ssas DAX in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/count-latest-plan-by-each-status-in-ssas-DAX/m-p/2387137#M61908</link>
    <description>&lt;P&gt;Anonymous&lt;/LI-USER&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Please let me know what is the issue you are facing. I might be able to support you.&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Thu, 10 Mar 2022 19:15:32 GMT</pubDate>
    <dc:creator>tamerj1</dc:creator>
    <dc:date>2022-03-10T19:15:32Z</dc:date>
    <item>
      <title>count latest plan by each status in ssas DAX</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/count-latest-plan-by-each-status-in-ssas-DAX/m-p/2385077#M61764</link>
      <description>&lt;P&gt;Hi Team,&lt;/P&gt;&lt;P&gt;I need to create measure based on latest status. I tried dax query in ssas (SSMS) but not getting expected results.&lt;/P&gt;&lt;P&gt;Logic: We need to calculate count by each&amp;nbsp; status on latest plan.&amp;nbsp;&lt;/P&gt;&lt;P&gt;for example: employee (5245) is having two plans (8869,6988)&amp;nbsp;&lt;/P&gt;&lt;P&gt;when we calculate status for accepted then we have to consider this empid becauase latest planid(8869) staus is accepted .i.e. this eid should consider status:&amp;nbsp;ACCEPTED only because it has the latest planid.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;U&gt;&lt;STRONG&gt;Source Data&lt;/STRONG&gt;&lt;/U&gt;&lt;/P&gt;&lt;TABLE&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;unit&lt;/TD&gt;&lt;TD&gt;eid&lt;/TD&gt;&lt;TD&gt;planid&lt;/TD&gt;&lt;TD&gt;Status&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;CATEGORY&lt;/TD&gt;&lt;TD&gt;5245&lt;/TD&gt;&lt;TD&gt;8869&lt;/TD&gt;&lt;TD&gt;ACCEPTED&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;CATEGORY&lt;/TD&gt;&lt;TD&gt;5245&lt;/TD&gt;&lt;TD&gt;6988&lt;/TD&gt;&lt;TD&gt;ESCALATED&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;U&gt;&lt;STRONG&gt;Output Expected&lt;/STRONG&gt;&lt;/U&gt;&lt;/P&gt;&lt;TABLE&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;unit&lt;/TD&gt;&lt;TD&gt;eid&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;TD&gt;Status&lt;/TD&gt;&lt;TD&gt;[AcceptedCount_Status]&lt;/TD&gt;&lt;TD&gt;[EscalatedCount_Status]&lt;/TD&gt;&lt;TD&gt;[OverallCount]&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;CATEGORY&lt;/TD&gt;&lt;TD&gt;5245&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;TD&gt;ACCEPTED&lt;/TD&gt;&lt;TD&gt;1&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;TD&gt;1&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;U&gt;&lt;STRONG&gt;Query :SSAS DAX in SSMS&lt;/STRONG&gt;&lt;/U&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Define&lt;BR /&gt;MEASURE table[AcceptedCount] =&lt;/P&gt;&lt;P&gt;COUNTROWS (&lt;BR /&gt;FILTER (&lt;BR /&gt;SUMMARIZE ( table,table[EmployeeNumber],table[status]),&lt;BR /&gt;table[status] = "ACCEPTED"&lt;BR /&gt;))&lt;/P&gt;&lt;P&gt;MEASURE table[EscalatedCount] =&lt;BR /&gt;COUNTROWS (&lt;BR /&gt;FILTER (&lt;BR /&gt;SUMMARIZE ( table,table[EmployeeNumber],table[status]),&lt;BR /&gt;table[status] = "ESCALATED"&lt;BR /&gt;))&lt;/P&gt;&lt;P&gt;MEASURE table[overall] =&lt;BR /&gt;COUNTROWS (&lt;BR /&gt;FILTER (&lt;BR /&gt;SUMMARIZE ( table,table[EmployeeNumber],table[status]),&lt;BR /&gt;table[status] in {"ESCALATED","ACCEPTED"}&lt;BR /&gt;))&lt;/P&gt;&lt;P&gt;VAR status_count =&lt;/P&gt;&lt;P&gt;SUMMARIZECOLUMNS (&lt;BR /&gt;table[unit],&lt;/P&gt;&lt;P&gt;"AcceptedCount_status", table[AcceptedCount],&lt;BR /&gt;"EscalatedCount_status", table[EscalatedCount]&lt;BR /&gt;"Overallcount",table[overall]&lt;BR /&gt;)&lt;/P&gt;&lt;P&gt;evaluate status_count&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;U&gt;&lt;STRONG&gt;Currently returning output with my query&lt;/STRONG&gt;&lt;/U&gt;&lt;/P&gt;&lt;TABLE&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;unit&lt;/TD&gt;&lt;TD&gt;eid&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;TD&gt;Status&lt;/TD&gt;&lt;TD&gt;[AcceptedCount_Status]&lt;/TD&gt;&lt;TD&gt;[EscalatedCount]_Status&lt;/TD&gt;&lt;TD&gt;[OverallCount]&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;CATEGORY&lt;/TD&gt;&lt;TD&gt;5245&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;TD&gt;ACCEPTED&lt;/TD&gt;&lt;TD&gt;1&lt;/TD&gt;&lt;TD&gt;1&lt;/TD&gt;&lt;TD&gt;2&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks in Advance&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 10 Mar 2022 07:07:25 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/count-latest-plan-by-each-status-in-ssas-DAX/m-p/2385077#M61764</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2022-03-10T07:07:25Z</dc:date>
    </item>
    <item>
      <title>Re: count latest plan by each status in ssas DAX</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/count-latest-plan-by-each-status-in-ssas-DAX/m-p/2386105#M61825</link>
      <description>&lt;P&gt;Hi&amp;nbsp;Anonymous&lt;/LI-USER&gt;&amp;nbsp;&lt;BR /&gt;You may try the following&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;DEFINE
    MEASURE table[AcceptedCount] =
        COUNTROWS ( CALCULATETABLE ( table, table[status] = "ACCEPTED" ) )
    MEASURE table[EscalatedCount] =
        COUNTROWS ( CALCULATETABLE ( table, table[status] = "ESCALATED" ) )
    MEASURE table[overall] =
        COUNTROWS (
            CALCULATETABLE ( table, table[status] IN { "ESCALATED", "ACCEPTED" } )
        )
    VAR status_count =
        SUMMARIZECOLUMNS (
            table[unit],
            "AcceptedCount_status", [AcceptedCount],
            "EscalatedCount_status", [EscalatedCount],
            "Overallcount", [overall]
        )

EVALUATE
status_count&lt;/LI-CODE&gt;</description>
      <pubDate>Thu, 10 Mar 2022 11:43:33 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/count-latest-plan-by-each-status-in-ssas-DAX/m-p/2386105#M61825</guid>
      <dc:creator>tamerj1</dc:creator>
      <dc:date>2022-03-10T11:43:33Z</dc:date>
    </item>
    <item>
      <title>Re: count latest plan by each status in ssas DAX</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/count-latest-plan-by-each-status-in-ssas-DAX/m-p/2386127#M61826</link>
      <description>&lt;P&gt;Anonymous&lt;/LI-USER&gt;&amp;nbsp;&lt;BR /&gt;Actually after a second look at your requirement I noticed something which is not clear. You are summarizing by status. Therefore, in all cases for "overall" you will either get the count for "Accepted" or the count of 'Escalated". If your goal is just to merge the counts of both "Accepted" and 'Escalated" to have one column without gaps, then you can do the following&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;DEFINE
    MEASURE table[AcceptedCount] =
        COUNTROWS ( CALCULATETABLE ( table, table[status] = "ACCEPTED" ) )
    MEASURE table[EscalatedCount] =
        COUNTROWS ( CALCULATETABLE ( table, table[status] = "ESCALATED" ) )
    VAR status_count =
        SUMMARIZECOLUMNS (
            table[unit],
            "AcceptedCount_status", [AcceptedCount],
            "EscalatedCount_status", [EscalatedCount],
            "Overallcount", [AcceptedCount] + [EscalatedCount]
        )

EVALUATE
status_count&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 10 Mar 2022 11:54:34 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/count-latest-plan-by-each-status-in-ssas-DAX/m-p/2386127#M61826</guid>
      <dc:creator>tamerj1</dc:creator>
      <dc:date>2022-03-10T11:54:34Z</dc:date>
    </item>
    <item>
      <title>Re: count latest plan by each status in ssas DAX</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/count-latest-plan-by-each-status-in-ssas-DAX/m-p/2386270#M61834</link>
      <description>&lt;P&gt;Hi&amp;nbsp;@&lt;SPAN&gt;tamerj1,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;The query&amp;nbsp; which you given is resulting count as '1' in both accepted and escalated like below but this is not expected&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&lt;img /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;For ex:&amp;nbsp; we need to return onlymax planid status of emp&lt;/SPAN&gt;&lt;/P&gt;&lt;OL&gt;&lt;LI&gt;&lt;SPAN&gt;5245 emp is having two planids&amp;nbsp;8869,6988 in that maxplanid is:8869 and sttaus of that max planid is : Accepted then we have to return count as "1" in accepted count. empty in escalated count column&lt;/SPAN&gt;&lt;/LI&gt;&lt;LI&gt;&lt;SPAN&gt;7676emp is having two planids&amp;nbsp;9898,9079 in that maxplanid is:9898 and sttaus of that max planid is : Esclated then we have to return count as "1" in Esclated count. empty in Accepted count column&lt;/SPAN&gt;&lt;/LI&gt;&lt;/OL&gt;&lt;P&gt;&lt;STRONG&gt;Refer the below snap for the expected output&lt;/STRONG&gt;&lt;/P&gt;&lt;OL&gt;&lt;LI&gt;&lt;SPAN&gt;&lt;img /&gt;&lt;/SPAN&gt;&lt;/LI&gt;&lt;/OL&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;U&gt;&lt;STRONG&gt;Source Data&lt;/STRONG&gt;&lt;/U&gt;&lt;/P&gt;&lt;P&gt;&lt;U&gt;&lt;STRONG&gt;&lt;img /&gt;&lt;/STRONG&gt;&lt;/U&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;U&gt;&lt;STRONG&gt;Expected Output&lt;/STRONG&gt;&lt;/U&gt;&lt;/P&gt;&lt;P&gt;&lt;U&gt;&lt;img /&gt;&lt;/U&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Please let me if you need anything&lt;/P&gt;</description>
      <pubDate>Thu, 10 Mar 2022 13:00:03 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/count-latest-plan-by-each-status-in-ssas-DAX/m-p/2386270#M61834</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2022-03-10T13:00:03Z</dc:date>
    </item>
    <item>
      <title>Re: count latest plan by each status in ssas DAX</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/count-latest-plan-by-each-status-in-ssas-DAX/m-p/2386313#M61836</link>
      <description>&lt;P&gt;Anonymous&lt;/LI-USER&gt;&amp;nbsp;&lt;BR /&gt;Ok&amp;nbsp;&lt;BR /&gt;So we have to consider&amp;nbsp;the first status per each id? Please clarify further&lt;/P&gt;</description>
      <pubDate>Thu, 10 Mar 2022 13:11:12 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/count-latest-plan-by-each-status-in-ssas-DAX/m-p/2386313#M61836</guid>
      <dc:creator>tamerj1</dc:creator>
      <dc:date>2022-03-10T13:11:12Z</dc:date>
    </item>
    <item>
      <title>Re: count latest plan by each status in ssas DAX</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/count-latest-plan-by-each-status-in-ssas-DAX/m-p/2386339#M61839</link>
      <description>&lt;P&gt;Let me clarify my concer further.&amp;nbsp;&lt;BR /&gt;For CATEGORY - 5245 we have both "ACCEPTED" and "EXCALATED" but you want to select "ACCEPTED". That's fine but on which bases?&lt;BR /&gt;Same for Channel - 7676&amp;nbsp;we have both "ACCEPTED" and "EXCALATED" but you want to select "EXCALATED"... On which bases?&lt;/P&gt;</description>
      <pubDate>Thu, 10 Mar 2022 13:19:30 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/count-latest-plan-by-each-status-in-ssas-DAX/m-p/2386339#M61839</guid>
      <dc:creator>tamerj1</dc:creator>
      <dc:date>2022-03-10T13:19:30Z</dc:date>
    </item>
    <item>
      <title>Re: count latest plan by each status in ssas DAX</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/count-latest-plan-by-each-status-in-ssas-DAX/m-p/2386482#M61848</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="317289" data-lia-user-login="tamerj1" class="lia-mention lia-mention-user"&gt;tamerj1&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Based on the maxium planid column&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 10 Mar 2022 14:10:45 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/count-latest-plan-by-each-status-in-ssas-DAX/m-p/2386482#M61848</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2022-03-10T14:10:45Z</dc:date>
    </item>
    <item>
      <title>Re: count latest plan by each status in ssas DAX</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/count-latest-plan-by-each-status-in-ssas-DAX/m-p/2386556#M61851</link>
      <description>&lt;P&gt;Anonymous&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Here you go&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;DEFINE
    MEASURE table[AcceptedCount] =
        VAR MaxPanID =
            MAX ( table[planid] )
        RETURN
            COUNTROWS (
                CALCULATETABLE ( table, table[status] = "ACCEPTED", table[planid] = MaxPanID )
            )
    MEASURE table[EscalatedCount] =
        VAR MaxPanID =
            MAX ( table[planid] )
        RETURN
            COUNTROWS (
                CALCULATETABLE ( table, table[status] = "ESCALATED", table[planid] = MaxPanID )
            )
    VAR status_count =
        SUMMARIZECOLUMNS (
            table[unit],
            "AcceptedCount_status", [AcceptedCount],
            "EscalatedCount_status", [EscalatedCount],
            "Overallcount", [AcceptedCount] + [EscalatedCount]
        )

EVALUATE
status_count&lt;/LI-CODE&gt;</description>
      <pubDate>Thu, 10 Mar 2022 14:36:11 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/count-latest-plan-by-each-status-in-ssas-DAX/m-p/2386556#M61851</guid>
      <dc:creator>tamerj1</dc:creator>
      <dc:date>2022-03-10T14:36:11Z</dc:date>
    </item>
    <item>
      <title>Re: count latest plan by each status in ssas DAX</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/count-latest-plan-by-each-status-in-ssas-DAX/m-p/2387107#M61906</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="317289" data-lia-user-login="tamerj1" class="lia-mention lia-mention-user"&gt;tamerj1&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;Can we write &lt;STRONG&gt;count/distinct count&lt;/STRONG&gt; instead of &lt;STRONG&gt;countrows&lt;/STRONG&gt; in measure expressions?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;ex:&amp;nbsp;&lt;/P&gt;&lt;P&gt;MEASURE table[AcceptedCount] =&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; VAR MaxPanID =&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; MAX ( table[planid] )&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; RETURN&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; COUNT (&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; CALCULATETABLE ( table, table[status] = "ACCEPTED", table[planid] = MaxPanID )&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; )&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 10 Mar 2022 18:42:21 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/count-latest-plan-by-each-status-in-ssas-DAX/m-p/2387107#M61906</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2022-03-10T18:42:21Z</dc:date>
    </item>
    <item>
      <title>Re: count latest plan by each status in ssas DAX</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/count-latest-plan-by-each-status-in-ssas-DAX/m-p/2387123#M61907</link>
      <description>&lt;P&gt;Anonymous&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;No. But you can use COUNTROWS ( DISTINCT ( ) )&lt;/P&gt;</description>
      <pubDate>Thu, 10 Mar 2022 18:56:46 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/count-latest-plan-by-each-status-in-ssas-DAX/m-p/2387123#M61907</guid>
      <dc:creator>tamerj1</dc:creator>
      <dc:date>2022-03-10T18:56:46Z</dc:date>
    </item>
    <item>
      <title>Re: count latest plan by each status in ssas DAX</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/count-latest-plan-by-each-status-in-ssas-DAX/m-p/2387137#M61908</link>
      <description>&lt;P&gt;Anonymous&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Please let me know what is the issue you are facing. I might be able to support you.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 10 Mar 2022 19:15:32 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/count-latest-plan-by-each-status-in-ssas-DAX/m-p/2387137#M61908</guid>
      <dc:creator>tamerj1</dc:creator>
      <dc:date>2022-03-10T19:15:32Z</dc:date>
    </item>
    <item>
      <title>Re: count latest plan by each status in ssas DAX</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/count-latest-plan-by-each-status-in-ssas-DAX/m-p/2394403#M62406</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="317289" data-lia-user-login="tamerj1" class="lia-mention lia-mention-user"&gt;tamerj1&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Please modify the query according to this requirement.&lt;/P&gt;&lt;P&gt;&lt;U&gt;&lt;STRONG&gt;Source Data:&lt;/STRONG&gt;&lt;/U&gt;&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&lt;U&gt;&lt;STRONG&gt;Expected Output&lt;/STRONG&gt;&lt;/U&gt;&lt;/P&gt;&lt;P&gt;&lt;U&gt;&lt;STRONG&gt;&lt;img /&gt;&lt;/STRONG&gt;&lt;/U&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&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;&lt;U&gt;&lt;STRONG&gt;But i'm getting below output with these query&lt;/STRONG&gt;&lt;/U&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;U&gt;&lt;STRONG&gt;&lt;img /&gt;&lt;/STRONG&gt;&lt;/U&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Please let me know if required anything&lt;/STRONG&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 15 Mar 2022 07:57:42 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/count-latest-plan-by-each-status-in-ssas-DAX/m-p/2394403#M62406</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2022-03-15T07:57:42Z</dc:date>
    </item>
    <item>
      <title>Re: count latest plan by each status in ssas DAX</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/count-latest-plan-by-each-status-in-ssas-DAX/m-p/2394587#M62418</link>
      <description>&lt;P&gt;HI&amp;nbsp;Anonymous&lt;/a&gt;&amp;nbsp;&lt;BR /&gt;You can just add "eid" to the filter context&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;DEFINE
    MEASURE source[AcceptedCount] =
        VAR MaxPanID =
            MAX ( source[planid] )
        RETURN
            COUNTROWS (
                CALCULATETABLE ( source, source[status] = "ACCEPTED", source[planid] = MaxPanID )
            )
    MEASURE source[EscalatedCount] =
        VAR MaxPanID =
            MAX ( source[planid] )
        RETURN
            COUNTROWS (
                CALCULATETABLE ( source, source[status] = "ESCALATED", source[planid] = MaxPanID )
            )
    VAR status_count =
        SUMMARIZECOLUMNS (
            source[unit],
            source[planid],
            "AcceptedCount_status", [AcceptedCount],
            "EscalatedCount_status", [EscalatedCount],
            "Overallcount", [AcceptedCount] + [EscalatedCount]
        )

EVALUATE
status_count&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Please let me know If you don't want to show "planid" in the output of the query.&lt;/P&gt;</description>
      <pubDate>Tue, 15 Mar 2022 08:54:02 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/count-latest-plan-by-each-status-in-ssas-DAX/m-p/2394587#M62418</guid>
      <dc:creator>tamerj1</dc:creator>
      <dc:date>2022-03-15T08:54:02Z</dc:date>
    </item>
    <item>
      <title>Re: count latest plan by each status in ssas DAX</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/count-latest-plan-by-each-status-in-ssas-DAX/m-p/2395401#M62468</link>
      <description>&lt;P&gt;Anonymous&lt;/a&gt;&amp;nbsp;&lt;BR /&gt;This query should work without having to add "PlanID" to the report&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;DEFINE
    MEASURE source[AcceptedCount] =
        SUMX (
            VALUES ( Source[eid] ),
            VAR MaxPlanID =
                CALCULATE ( MAX ( Source[planid] ) )
            RETURN
                CALCULATE (
                    COUNTROWS ( SOURCE ),
                    Source[planid] = MaxPlanID,
                    Source[status] = "ACCEPTED"
                )
        )
    MEASURE source[EscalatedCount] =
        SUMX (
            VALUES ( Source[eid] ),
            VAR MaxPlanID =
                CALCULATE ( MAX ( Source[planid] ) )
            RETURN
                CALCULATE (
                    COUNTROWS ( SOURCE ),
                    Source[planid] = MaxPlanID,
                    Source[status] = "ESCALATED"
                )
        )
    VAR status_count =
        SUMMARIZECOLUMNS (
            source[unit],
            "AcceptedCount_status", [AcceptedCount],
            "EscalatedCount_status", [EscalatedCount],
            "Overallcount", [AcceptedCount] + [EscalatedCount]
        )

EVALUATE
status_count&lt;/LI-CODE&gt;</description>
      <pubDate>Tue, 15 Mar 2022 13:31:37 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/count-latest-plan-by-each-status-in-ssas-DAX/m-p/2395401#M62468</guid>
      <dc:creator>tamerj1</dc:creator>
      <dc:date>2022-03-15T13:31:37Z</dc:date>
    </item>
  </channel>
</rss>

