<?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: Value of orders shipping this period, created last working day in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Value-of-orders-shipping-this-period-created-last-working-day/m-p/2909758#M95072</link>
    <description>&lt;P&gt;Yeah, I do have that as an option and like you say, it's much more straightforward then.&lt;/P&gt;</description>
    <pubDate>Wed, 16 Nov 2022 14:21:08 GMT</pubDate>
    <dc:creator>philadams</dc:creator>
    <dc:date>2022-11-16T14:21:08Z</dc:date>
    <item>
      <title>Value of orders shipping this period, created last working day</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Value-of-orders-shipping-this-period-created-last-working-day/m-p/2909517#M95039</link>
      <description>&lt;P&gt;Hi, I have the following tables and am trying to calculate the value of orders created on the last working day that are shipping in the current period. Or, which is how i'm currently trying to calculate it, the value of orders shipping in this period that were created on the last working day.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Customer Orders&lt;/STRONG&gt;&lt;/P&gt;&lt;TABLE border="1"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;Customer Order&lt;/TD&gt;&lt;TD&gt;Order Date&lt;/TD&gt;&lt;TD&gt;Estimated Ship Date&lt;/TD&gt;&lt;TD&gt;Value&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;1&lt;/TD&gt;&lt;TD&gt;14/11/22&lt;/TD&gt;&lt;TD&gt;21/11/22&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;10000&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;2&lt;/TD&gt;&lt;TD&gt;15/11/22&lt;/TD&gt;&lt;TD&gt;15/12/22&lt;/TD&gt;&lt;TD&gt;15000&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Dates&lt;/STRONG&gt;&lt;/P&gt;&lt;TABLE border="1"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;Dates&lt;/TD&gt;&lt;TD&gt;Is Current Period&lt;/TD&gt;&lt;TD&gt;Is Last Working Day&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;14/11/22&lt;/TD&gt;&lt;TD&gt;TRUE&lt;/TD&gt;&lt;TD&gt;TRUE&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;...&lt;/TD&gt;&lt;TD&gt;...&lt;/TD&gt;&lt;TD&gt;...&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;15/12/22&lt;/TD&gt;&lt;TD&gt;FALSE&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;FALSE&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have an active relationship between Order Date and the dates table, and an inactive one between Estimated Ship Date and the dates table. Building in steps i've created the following;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;Total Ordered Value =
    SUM('Customer Orders'[Value])&lt;/LI-CODE&gt;&lt;LI-CODE lang="markup"&gt;Order Value by Ship Date =
CALCULATE (
    [Total Ordered Value],
    USERELATIONSHIP ( 'Customer Orders'[Estimated Ship Date], Dates[Date] )
)&lt;/LI-CODE&gt;&lt;LI-CODE lang="markup"&gt;Order Value Shipping This Period =
CALCULATE (
    [Order Value by Ship Date],
    FILTER ( Dates, Dates[Is Current Period] = TRUE )
)&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;These all work correctly, but where i'm stuck is creating the final measure that takes the last one above but filters it using the Order Date that has a related date record where 'Is Last Working Day' = TRUE. I've tried a few variations but I think i'm coming unstuck with how to implement the pattern that uses a different relationship on the final filter. It could be that i've started on the wrong foot so any pointers on this are appreciated.&lt;/P&gt;</description>
      <pubDate>Wed, 16 Nov 2022 12:45:30 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Value-of-orders-shipping-this-period-created-last-working-day/m-p/2909517#M95039</guid>
      <dc:creator>philadams</dc:creator>
      <dc:date>2022-11-16T12:45:30Z</dc:date>
    </item>
    <item>
      <title>Re: Value of orders shipping this period, created last working day</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Value-of-orders-shipping-this-period-created-last-working-day/m-p/2909671#M95055</link>
      <description>&lt;P&gt;Might be this... but it's not entirely clear what you want. You should always be absolutely clear about what you want and give good examples, even if by hand. This is because you know what you want, we don't know anything about your model.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="csharp"&gt;[Order Value Shipping This Period] =
CALCULATE (
    [Order Value by Ship Date],
    KEEPFILTERS( 
        Dates[Last Working Day]
    )
)&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 16 Nov 2022 13:50:25 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Value-of-orders-shipping-this-period-created-last-working-day/m-p/2909671#M95055</guid>
      <dc:creator>daXtreme</dc:creator>
      <dc:date>2022-11-16T13:50:25Z</dc:date>
    </item>
    <item>
      <title>Re: Value of orders shipping this period, created last working day</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Value-of-orders-shipping-this-period-created-last-working-day/m-p/2909713#M95060</link>
      <description>&lt;P&gt;Apologies, I should have put a better example of what I was expecting to be returned. The date filters that i'm using in the date table (Is Last Working Day etc.) are recalculated each day so are always relative to todays date.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If todays date was 15/11/22 (is last working day would be true for the 14/11/22, current period would be true for all dates in todays period)&lt;/P&gt;&lt;P&gt;I want to return a value of 10000, as there was is an order on the last working day that ships in the current period&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If todays date was 16/11/22 (is last working day would be true for the 15/11/22, current period would be true for all dates in todays period)&lt;/P&gt;&lt;P&gt;I want to return a value of 0, as there was an order placed on the last working day but it does not ship in the current period.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm assuming there is a pattern for this as the date filters could be almost anything, i.e. order value shipping next month, but created this month, for example.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;EDIT: Fundamentally, what i'm trying to achieve is filtering a table by both an active relationship (order_date) and an inactive relationship (estimated_ship_date), using different fields from the same related table. Other ways i've though about it is creating a table with all orders created yesterday, then all orders with a ship date in this period and doing an intersect, but this feels more complex than it needs to (accepting that it might not be).&lt;/P&gt;</description>
      <pubDate>Wed, 16 Nov 2022 14:09:18 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Value-of-orders-shipping-this-period-created-last-working-day/m-p/2909713#M95060</guid>
      <dc:creator>philadams</dc:creator>
      <dc:date>2022-11-16T14:09:18Z</dc:date>
    </item>
    <item>
      <title>Re: Value of orders shipping this period, created last working day</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Value-of-orders-shipping-this-period-created-last-working-day/m-p/2909734#M95067</link>
      <description>&lt;P&gt;The easiest way is to have 2 date tables, one that will join on one type of date (Ship Calendar), the other on the other (Order Calendar). This way it's dead easy to achieve what you want by selecting from them. Only thing is name the tables some sensible names and always remember which Calendar you're working with.&lt;/P&gt;</description>
      <pubDate>Wed, 16 Nov 2022 14:14:20 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Value-of-orders-shipping-this-period-created-last-working-day/m-p/2909734#M95067</guid>
      <dc:creator>daXtreme</dc:creator>
      <dc:date>2022-11-16T14:14:20Z</dc:date>
    </item>
    <item>
      <title>Re: Value of orders shipping this period, created last working day</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Value-of-orders-shipping-this-period-created-last-working-day/m-p/2909758#M95072</link>
      <description>&lt;P&gt;Yeah, I do have that as an option and like you say, it's much more straightforward then.&lt;/P&gt;</description>
      <pubDate>Wed, 16 Nov 2022 14:21:08 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Value-of-orders-shipping-this-period-created-last-working-day/m-p/2909758#M95072</guid>
      <dc:creator>philadams</dc:creator>
      <dc:date>2022-11-16T14:21:08Z</dc:date>
    </item>
  </channel>
</rss>

