<?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: Countrows from Sumx in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Countrows-from-Sumx/m-p/2399129#M62704</link>
    <description>&lt;P&gt;A Small screen shot of the data, its pretty simple pick up parcels from one location by State and ship it to another by State then its either Overnight or Off-Peak&amp;nbsp; (x days).&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;Count the week days between Pick up &amp;amp; Delivered date.&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;Delivery Days = if( not(isblank([Pick Up Date])) &amp;amp;&amp;amp; not(isblank([Actual Delivered Date])),
COUNTROWS (
    FILTER (
        ADDCOLUMNS (
            CALENDAR ( 
                'Toll_Shipments'[Pick Up Date],
                Toll_Shipments[Actual Delivered Date]
                  ),
            "Is Weekday",WEEKDAY([date],2)&amp;lt;6
            ,"Is Holiday", CONTAINS('Holiday Dates','Holiday Dates'[Dates],[Date] )
        ),
        [Is Holiday] = FALSE() 
           &amp;amp;&amp;amp; [Is Weekday] = TRUE()
    )
),BLANK())&lt;/LI-CODE&gt;&lt;P&gt;Then if the delivery days are higher than the overnight max (SLA number) return red. This works great but now I need to count the number of rows which are red.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;tas 1 format days =
var _delivered = SUMX(toll_shipments, Toll_Shipments[Delivery Days])
var _maxdays = SUMX(Delivery Times Ex Tasmania, Delivery Times Ex Tasmania[Overnight Max])

return
IF(_delivered &amp;gt; _maxdays,"Red","Black")&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Attempt to count the red rows only, this has a error "True False expression does not specify one column. Each True/False expressions used a table filter expression must refer to exactly one column.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;tas 1 count days = 
var _delivered = SUMX(Toll_Shipments,Toll_Shipments[Delivery Days])
var _maxdays = sumx('Delivery Times Ex Tasmania','Delivery Times Ex Tasmania'[Overnight Max])

return
IF(_delivered &amp;gt; _maxdays,Calculate(countrows(toll_shipments),filter(toll_shipments, Toll_Shipments[Sender State] = "TAS" &amp;amp;&amp;amp; Toll_Shipments[Shipment Type] = "Overnight"),0))&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;I've tried a few different combinations and haven't got it work yet.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks for any assistance.&lt;/P&gt;</description>
    <pubDate>Wed, 16 Mar 2022 23:53:21 GMT</pubDate>
    <dc:creator>ringovski</dc:creator>
    <dc:date>2022-03-16T23:53:21Z</dc:date>
    <item>
      <title>Countrows from Sumx</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Countrows-from-Sumx/m-p/2396772#M62566</link>
      <description>&lt;P&gt;Hi All,&lt;/P&gt;&lt;P&gt;I conditionaly format a number column if the delivery day exceed the overnight max (agreed SLA) , this is simple enough. Works great highlights the rows which exceed the SLA. Now I need to count them, but I am unable to get this working.&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;tas 1 format days =
var _delivered = SUMX(toll_shipments, Toll_Shipments[Delivery Days])
var _maxdays = SUMX(Delivery Times Ex Tasmania, Delivery Times Ex Tasmania[Overnight Max])

return
IF(_delivered &amp;gt; _maxdays,"Red","Black")&lt;/LI-CODE&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I 've tried using a IF like the intial measure format days but it doesn't work, count days with calculate returns 85 and I'm not sure why and you can see that it should be 8.&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;tas 1 count days =
var _delivered = SUMX(toll_shipments, Toll_Shipments[Delivery Days])
var _maxdays = SUMX(Delivery Times Ex Tasmania, Delivery Times Ex Tasmania[Overnight Max])

return
Calculate(countrows(toll_shipments),toll_shipments[sender state]="TAS", Toll_Shipments[Shipment Type = "Overnight")&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks for any assistance.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 16 Mar 2022 03:57:56 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Countrows-from-Sumx/m-p/2396772#M62566</guid>
      <dc:creator>ringovski</dc:creator>
      <dc:date>2022-03-16T03:57:56Z</dc:date>
    </item>
    <item>
      <title>Re: Countrows from Sumx</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Countrows-from-Sumx/m-p/2396780#M62567</link>
      <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="342511" data-lia-user-login="ringovski" class="lia-mention lia-mention-user"&gt;ringovski&lt;/a&gt; , Try like&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;tas 1 count days =&lt;BR /&gt;var _delivered = SUMX(toll_shipments, Toll_Shipments[Delivery Days])&lt;BR /&gt;var _maxdays = SUMX(Delivery Times Ex Tasmania, Delivery Times Ex Tasmania[Overnight Max])&lt;/P&gt;
&lt;P&gt;return&lt;BR /&gt;Calculate(countrows(toll_shipments),filter(toll_shipments, toll_shipments[sender state]="TAS", Toll_Shipments[Shipment Type = "Overnight"))&lt;/P&gt;</description>
      <pubDate>Wed, 16 Mar 2022 04:01:35 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Countrows-from-Sumx/m-p/2396780#M62567</guid>
      <dc:creator>amitchandak</dc:creator>
      <dc:date>2022-03-16T04:01:35Z</dc:date>
    </item>
    <item>
      <title>Re: Countrows from Sumx</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Countrows-from-Sumx/m-p/2398858#M62669</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="342511" data-lia-user-login="ringovski" class="lia-mention lia-mention-user"&gt;ringovski&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;what are you slicing by?&lt;/P&gt;&lt;P&gt;can you please share a screeor you data modrl and your visual blanching out any sensitive data?&lt;/P&gt;</description>
      <pubDate>Wed, 16 Mar 2022 18:07:40 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Countrows-from-Sumx/m-p/2398858#M62669</guid>
      <dc:creator>tamerj1</dc:creator>
      <dc:date>2022-03-16T18:07:40Z</dc:date>
    </item>
    <item>
      <title>Re: Countrows from Sumx</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Countrows-from-Sumx/m-p/2398975#M62686</link>
      <description>&lt;P&gt;hi &lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="342511" data-lia-user-login="ringovski" class="lia-mention lia-mention-user"&gt;ringovski&lt;/a&gt;,&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;please, tell us what does toll_shipments data is about. Show us a sample of couple of rows of the table (we need to see the columns Delivery days and Overnight max)&lt;/P&gt;</description>
      <pubDate>Wed, 16 Mar 2022 19:27:44 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Countrows-from-Sumx/m-p/2398975#M62686</guid>
      <dc:creator>m3tr01d</dc:creator>
      <dc:date>2022-03-16T19:27:44Z</dc:date>
    </item>
    <item>
      <title>Re: Countrows from Sumx</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Countrows-from-Sumx/m-p/2399129#M62704</link>
      <description>&lt;P&gt;A Small screen shot of the data, its pretty simple pick up parcels from one location by State and ship it to another by State then its either Overnight or Off-Peak&amp;nbsp; (x days).&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;Count the week days between Pick up &amp;amp; Delivered date.&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;Delivery Days = if( not(isblank([Pick Up Date])) &amp;amp;&amp;amp; not(isblank([Actual Delivered Date])),
COUNTROWS (
    FILTER (
        ADDCOLUMNS (
            CALENDAR ( 
                'Toll_Shipments'[Pick Up Date],
                Toll_Shipments[Actual Delivered Date]
                  ),
            "Is Weekday",WEEKDAY([date],2)&amp;lt;6
            ,"Is Holiday", CONTAINS('Holiday Dates','Holiday Dates'[Dates],[Date] )
        ),
        [Is Holiday] = FALSE() 
           &amp;amp;&amp;amp; [Is Weekday] = TRUE()
    )
),BLANK())&lt;/LI-CODE&gt;&lt;P&gt;Then if the delivery days are higher than the overnight max (SLA number) return red. This works great but now I need to count the number of rows which are red.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;tas 1 format days =
var _delivered = SUMX(toll_shipments, Toll_Shipments[Delivery Days])
var _maxdays = SUMX(Delivery Times Ex Tasmania, Delivery Times Ex Tasmania[Overnight Max])

return
IF(_delivered &amp;gt; _maxdays,"Red","Black")&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Attempt to count the red rows only, this has a error "True False expression does not specify one column. Each True/False expressions used a table filter expression must refer to exactly one column.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;tas 1 count days = 
var _delivered = SUMX(Toll_Shipments,Toll_Shipments[Delivery Days])
var _maxdays = sumx('Delivery Times Ex Tasmania','Delivery Times Ex Tasmania'[Overnight Max])

return
IF(_delivered &amp;gt; _maxdays,Calculate(countrows(toll_shipments),filter(toll_shipments, Toll_Shipments[Sender State] = "TAS" &amp;amp;&amp;amp; Toll_Shipments[Shipment Type] = "Overnight"),0))&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;I've tried a few different combinations and haven't got it work yet.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks for any assistance.&lt;/P&gt;</description>
      <pubDate>Wed, 16 Mar 2022 23:53:21 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Countrows-from-Sumx/m-p/2399129#M62704</guid>
      <dc:creator>ringovski</dc:creator>
      <dc:date>2022-03-16T23:53:21Z</dc:date>
    </item>
  </channel>
</rss>

