<?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: Using Except to filter out same orders but also compare only orders with from last workday. in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Using-Except-to-filter-out-same-orders-but-also-compare-only/m-p/2316223#M57717</link>
    <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="287137" data-lia-user-login="Applicable88" class="lia-mention lia-mention-user"&gt;Applicable88&lt;/a&gt;,&lt;/P&gt;&lt;P&gt;Does this one work for you?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;CountOrdersMeasure = 
Var _CurrentDate = 
Max ( ShippingTable[Date] )

Var _LatestPreparationDate = 
Calculate ( 
    Max ( PreparationTable[Date] ),
    PreparationTable[Date] &amp;lt; _CurrentDate 
)

Var _Orders_S =
Calculatetable (
    Values ( ShippingTable[OrderNo] ) , 
    ShippingTable[Status] = "S",
    PreparationTable[Date] = _LatestPreparationDate
)

Var _Orders_P =
Calculatetable (
    Values ( PreparationTable[OrderNo] ) , 
    PreparationTable[Status] = "P"
)

Return
Calculate ( 
    Count ( ShippingTable[OrderNo] ),
    Except (
        _Orders_S,
        _Orders_P
    )
)&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Hope this helps!&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;/Tom&lt;/P&gt;&lt;P&gt;&lt;A href="https://www.tackytech.blog/" target="_blank" rel="nofollow noopener noreferrer"&gt;https://www.tackytech.blog&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="https://www.instagram.com/tackytechtom/" target="_blank" rel="nofollow noopener noreferrer"&gt;https://www.instagram.com/tackytechtom&lt;/A&gt;&lt;/P&gt;</description>
    <pubDate>Wed, 02 Feb 2022 21:05:11 GMT</pubDate>
    <dc:creator>tackytechtom</dc:creator>
    <dc:date>2022-02-02T21:05:11Z</dc:date>
    <item>
      <title>Using Except to filter out same orders but also compare only orders with from last workday.</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Using-Except-to-filter-out-same-orders-but-also-compare-only/m-p/2315720#M57684</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;I want to check the performance of a dispatch team. Everyday we have a record of how much shipping we prepared and shipped. Those orders have the Status "S" for shipped.&lt;/P&gt;&lt;P&gt;We have another record of data, which are the leftover orders from the last working day. Those orders were also prepared, but were too late for shipping, so in the meantime we gave them the status "P" for prepared. So every "P" ordernumber will become an "S" order in the end.&amp;nbsp;&lt;/P&gt;&lt;P&gt;At the end of a working day we calculate the performance, of the team. We count how many orders were shipped today, but we have to deduct those orders which are also on the "P" table, since the main preparation work were already done on a workday before. The last workday can be three days ago when there was a weekend in between or one day for all other workdays. When the factory were closed because of christmas vacation the last working day can also be over one week or more ago. So the last working day cannot be a fixed value like&amp;nbsp; date = Max(Table(Date) - 1 or so. It needs to be the max (date) of the preparation table, but smaller than the shipping date.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have&amp;nbsp; sample data only for describing one particular workday which is a monday and the last workday was a Friday:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The shipping table:&amp;nbsp;&lt;/P&gt;&lt;TABLE&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;OrderNo.&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;TD&gt;Date&amp;nbsp;&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;TD&gt;Status&amp;nbsp;&lt;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;&amp;nbsp;&lt;/TD&gt;&lt;TD&gt;1000&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;1113&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;TD&gt;09/01/2022&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;TD&gt;P&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;TD&gt;1000&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;1114&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;TD&gt;09/01/2022&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;TD&gt;P&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;TD&gt;8000&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;1115&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;TD&gt;09/01/2022&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;TD&gt;P&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;TD&gt;10000&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;1116&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;TD&gt;09/01/2022&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;TD&gt;P&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;TD&gt;1500&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The right return of counts for the shipping date 10/01//2022 should be 3 orders, since the orders with the number 1119,1118 and 1000, are not listed in the preparation table from the last workday listed&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I know how to count only those which are not in preparation table:&lt;/P&gt;&lt;P&gt;CountOrdersMeasure =&amp;nbsp;&lt;/P&gt;&lt;P&gt;Var _Orders_S =&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;Calculatetable (&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; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;Values ( TableT [OrderNo.] ) ,&amp;nbsp;&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; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; TableT [Status] = "S"&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; )&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Var _Orders_P =&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;Calculatetable (&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; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;Values ( TableY [OrderNo.] ) ,&amp;nbsp;&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; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; TableT [Status] = "P"&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; )&lt;/P&gt;&lt;P&gt;Return&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;Calculate (&amp;nbsp;&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;Count ( TableT[OrderNo.] ),&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;Except (&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; &amp;nbsp; &amp;nbsp; &amp;nbsp;_Orders_S,&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; &amp;nbsp; &amp;nbsp; &amp;nbsp;_Orders_P&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; )&lt;/P&gt;&lt;P&gt;&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;But this function doesn't take into account that for every shipping day I only want to except those orders which are also in the preparation table which belongs to the last workday.&amp;nbsp;&lt;/P&gt;&lt;P&gt;I hope someone can help me out with that.&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you very much in advance.&amp;nbsp;&lt;/P&gt;&lt;P&gt;Best.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 02 Feb 2022 16:08:35 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Using-Except-to-filter-out-same-orders-but-also-compare-only/m-p/2315720#M57684</guid>
      <dc:creator>Applicable88</dc:creator>
      <dc:date>2022-02-02T16:08:35Z</dc:date>
    </item>
    <item>
      <title>Re: Using Except to filter out same orders but also compare only orders with from last workday.</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Using-Except-to-filter-out-same-orders-but-also-compare-only/m-p/2316223#M57717</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="287137" data-lia-user-login="Applicable88" class="lia-mention lia-mention-user"&gt;Applicable88&lt;/a&gt;,&lt;/P&gt;&lt;P&gt;Does this one work for you?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;CountOrdersMeasure = 
Var _CurrentDate = 
Max ( ShippingTable[Date] )

Var _LatestPreparationDate = 
Calculate ( 
    Max ( PreparationTable[Date] ),
    PreparationTable[Date] &amp;lt; _CurrentDate 
)

Var _Orders_S =
Calculatetable (
    Values ( ShippingTable[OrderNo] ) , 
    ShippingTable[Status] = "S",
    PreparationTable[Date] = _LatestPreparationDate
)

Var _Orders_P =
Calculatetable (
    Values ( PreparationTable[OrderNo] ) , 
    PreparationTable[Status] = "P"
)

Return
Calculate ( 
    Count ( ShippingTable[OrderNo] ),
    Except (
        _Orders_S,
        _Orders_P
    )
)&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Hope this helps!&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;/Tom&lt;/P&gt;&lt;P&gt;&lt;A href="https://www.tackytech.blog/" target="_blank" rel="nofollow noopener noreferrer"&gt;https://www.tackytech.blog&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="https://www.instagram.com/tackytechtom/" target="_blank" rel="nofollow noopener noreferrer"&gt;https://www.instagram.com/tackytechtom&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 02 Feb 2022 21:05:11 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Using-Except-to-filter-out-same-orders-but-also-compare-only/m-p/2316223#M57717</guid>
      <dc:creator>tackytechtom</dc:creator>
      <dc:date>2022-02-02T21:05:11Z</dc:date>
    </item>
    <item>
      <title>Re: Using Except to filter out same orders but also compare only orders with from last workday.</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Using-Except-to-filter-out-same-orders-but-also-compare-only/m-p/2317950#M57820</link>
      <description>&lt;P&gt;Hello&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="353745" data-lia-user-login="tackytechtom" class="lia-mention lia-mention-user"&gt;tackytechtom&lt;/a&gt;&amp;nbsp;, thank you so much so far! With that I think I got closer to my wanted outcome.&amp;nbsp;&lt;/P&gt;&lt;P&gt;But there is still one thing I need to change and I still haven't find the mistake yet. I guess its still the variables currentdates and lastpreparationdate which aren't working correctly.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I only get the right count when I use two additional slicer, one for shipping date and one for preparation date.&amp;nbsp;&lt;/P&gt;&lt;P&gt;Only when I limit the two dates like 09/01/2022 and 10/01/2022 it will give me the right result. So far I know that the except function works correctly.&amp;nbsp;&lt;/P&gt;&lt;P&gt;Might there be a mistake in the variables ?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 03 Feb 2022 15:20:27 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Using-Except-to-filter-out-same-orders-but-also-compare-only/m-p/2317950#M57820</guid>
      <dc:creator>Applicable88</dc:creator>
      <dc:date>2022-02-03T15:20:27Z</dc:date>
    </item>
    <item>
      <title>Re: Using Except to filter out same orders but also compare only orders with from last workday.</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Using-Except-to-filter-out-same-orders-but-also-compare-only/m-p/2319798#M57915</link>
      <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="353745" data-lia-user-login="tackytechtom" class="lia-mention lia-mention-user"&gt;tackytechtom&lt;/a&gt;&amp;nbsp;thank you so much. I found the little mistake, and now I get the correct results. Since the preparation table needs to be filtered to "last working day" the folliwing part belongs to the variable _Orders_P and not _Orders_S.&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;PreparationTable[Date] = _LatestPreparationDate&lt;/PRE&gt;&lt;LI-CODE lang="markup"&gt;CountOrdersMeasure = 
Var _CurrentDate = 
Max ( ShippingTable[Date] )

Var _LatestPreparationDate = 
Calculate ( 
    Max ( PreparationTable[Date] ),
    PreparationTable[Date] &amp;lt; _CurrentDate 
)

Var _Orders_S =
Calculatetable (
    Values ( ShippingTable[OrderNo] ) , 
    ShippingTable[Status] = "S"
    
)

Var _Orders_P =
Calculatetable (
    Values ( PreparationTable[OrderNo] ) , 
    PreparationTable[Status] = "P",
    PreparationTable[Date] = _LatestPreparationDate
)

Return
Calculate ( 
    Count ( ShippingTable[OrderNo] ),
    Except (
        _Orders_S,
        _Orders_P
    )
)&lt;/LI-CODE&gt;&lt;P&gt;Thanks so much!&lt;/P&gt;&lt;P&gt;Best.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 04 Feb 2022 12:43:03 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Using-Except-to-filter-out-same-orders-but-also-compare-only/m-p/2319798#M57915</guid>
      <dc:creator>Applicable88</dc:creator>
      <dc:date>2022-02-04T12:43:03Z</dc:date>
    </item>
  </channel>
</rss>

