<?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 Dax formula: how to use the last purchase cost prior to the filter date in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Dax-formula-how-to-use-the-last-purchase-cost-prior-to-the/m-p/3973242#M154057</link>
    <description>&lt;P&gt;Hello everyone, I have to write a DAX formula that&amp;nbsp;must takes into consideration the last purchase cost prior to the filter date of the period for which the margin is being calculated.&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;So the idea is that I could select a date to filter my report, next it should takes the last purchase cost prior the filter date, and then (with this cost) calculate the margin.&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;</description>
    <pubDate>Wed, 05 Jun 2024 06:58:09 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2024-06-05T06:58:09Z</dc:date>
    <item>
      <title>Dax formula: how to use the last purchase cost prior to the filter date</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Dax-formula-how-to-use-the-last-purchase-cost-prior-to-the/m-p/3973242#M154057</link>
      <description>&lt;P&gt;Hello everyone, I have to write a DAX formula that&amp;nbsp;must takes into consideration the last purchase cost prior to the filter date of the period for which the margin is being calculated.&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;So the idea is that I could select a date to filter my report, next it should takes the last purchase cost prior the filter date, and then (with this cost) calculate the margin.&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 05 Jun 2024 06:58:09 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Dax-formula-how-to-use-the-last-purchase-cost-prior-to-the/m-p/3973242#M154057</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2024-06-05T06:58:09Z</dc:date>
    </item>
    <item>
      <title>Re: Dax formula: how to use the last purchase cost prior to the filter date</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Dax-formula-how-to-use-the-last-purchase-cost-prior-to-the/m-p/3973370#M154060</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;You can try this measure.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;Measure = CALCULATE(SUM('Fact'[Cost]),LASTDATE('Fact'[Date]&amp;lt;MAX('Fact'[Date])))&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If the date column used in slicer is from calendar table, then also need to remove the date filter.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;Measure = CALCULATE(SUM('Fact'[Cost]),LASTDATE('Fact'[Date]&amp;lt;MAX('Calendar'[Date])),ALL('Calendar'))&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Did I answer your question? If yes, pls mark my post as a solution and appreciate your Kudos !&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you~&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 05 Jun 2024 07:37:04 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Dax-formula-how-to-use-the-last-purchase-cost-prior-to-the/m-p/3973370#M154060</guid>
      <dc:creator>xifeng_L</dc:creator>
      <dc:date>2024-06-05T07:37:04Z</dc:date>
    </item>
  </channel>
</rss>

