<?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: Multiply colums according latest date in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Multiply-colums-according-latest-date/m-p/893387#M7957</link>
    <description>&lt;P&gt;&amp;nbsp;Please use the below logic&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;(1) Create a calculated column for finding the latest date for each group(Part, mat). If need, you include the qty in the filter clause&lt;/P&gt;&lt;DIV&gt;&lt;DIV&gt;L&lt;SPAN&gt;atestdate = &lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;CALCULATE(MAX('Table'[date]),FILTER('Table','Table'[Part]=EARLIER('Table'[Part])&amp;amp;&amp;amp;'Table'[Material]=EARLIER('Table'[Material])))&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;(2) Create column Flag for the latest record&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;Flag = IF('Table'[date]='Table'[latestdate],1,0)&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;Latest record will be flagged as 1 like below&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&lt;img /&gt;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;Now, filter out the old record by filtering the flag &amp;lt;&amp;gt;0. Also fetch the cost of latest date by using filter context in CALCULATE function&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;Please let me know if this solutions works&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;DIV class="mceNonEditable lia-copypaste-placeholder"&gt;&amp;nbsp;&lt;/DIV&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;/DIV&gt;</description>
    <pubDate>Wed, 08 Jan 2020 10:56:45 GMT</pubDate>
    <dc:creator>Parkavi</dc:creator>
    <dc:date>2020-01-08T10:56:45Z</dc:date>
    <item>
      <title>Multiply colums according latest date</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Multiply-colums-according-latest-date/m-p/893290#M7951</link>
      <description>&lt;P&gt;Hi all&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I would like to create a measure but i am stuck. I have a product, for the product different materials with quantities and unit prices.&lt;/P&gt;&lt;P&gt;But in the table I use I have historical data as well. So there are different unit prices with different dates.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;What I would like to do is filter out the latest dates for the duplicates and multiply the qty with unit price.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Kind of:&lt;/P&gt;&lt;P&gt;Part 1&amp;nbsp;&amp;nbsp; mat1&amp;nbsp;&amp;nbsp; 1pcs&amp;nbsp;&amp;nbsp;&amp;nbsp; 5Eur&amp;nbsp;&amp;nbsp; 1.12.2019&lt;/P&gt;&lt;P&gt;Part 1&amp;nbsp;&amp;nbsp;&amp;nbsp; mat2&amp;nbsp;&amp;nbsp; 0.3kg&amp;nbsp;&amp;nbsp; 8eur&amp;nbsp;&amp;nbsp;&amp;nbsp; 5.12.2019&lt;/P&gt;&lt;P&gt;Part 1&amp;nbsp;&amp;nbsp; mat3&amp;nbsp;&amp;nbsp; 0.8l&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 12eur&amp;nbsp;&amp;nbsp;&amp;nbsp; 11.12.2019&lt;/P&gt;&lt;P&gt;Part 1&amp;nbsp;&amp;nbsp;&amp;nbsp; mat1&amp;nbsp;&amp;nbsp; 1pcs&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 4.5eur&amp;nbsp;&amp;nbsp; 6.1.2019&lt;/P&gt;&lt;P&gt;Part 1&amp;nbsp;&amp;nbsp;&amp;nbsp; mat3&amp;nbsp;&amp;nbsp; 0.8l&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 10eur&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 5.1.2019&lt;/P&gt;&lt;P&gt;Part 2&amp;nbsp;&amp;nbsp;&amp;nbsp; mat1&amp;nbsp; 0.4pcs&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 6 eur&amp;nbsp;&amp;nbsp; 6.9.2019&lt;/P&gt;&lt;P&gt;Part 2&amp;nbsp;&amp;nbsp; mat2&amp;nbsp; 0.6l&amp;nbsp;&amp;nbsp;&amp;nbsp; 8 eur&amp;nbsp;&amp;nbsp;&amp;nbsp; 12.12.2019&lt;/P&gt;&lt;P&gt;......&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;There is an update on part1 mat1 and mat3 (material) with the latest date and only that is what i would like to see in the product (part1)&amp;nbsp; costs.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank You&lt;/P&gt;</description>
      <pubDate>Wed, 08 Jan 2020 09:42:18 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Multiply-colums-according-latest-date/m-p/893290#M7951</guid>
      <dc:creator>Tommyvhod</dc:creator>
      <dc:date>2020-01-08T09:42:18Z</dc:date>
    </item>
    <item>
      <title>Re: Multiply colums according latest date</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Multiply-colums-according-latest-date/m-p/893387#M7957</link>
      <description>&lt;P&gt;&amp;nbsp;Please use the below logic&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;(1) Create a calculated column for finding the latest date for each group(Part, mat). If need, you include the qty in the filter clause&lt;/P&gt;&lt;DIV&gt;&lt;DIV&gt;L&lt;SPAN&gt;atestdate = &lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;CALCULATE(MAX('Table'[date]),FILTER('Table','Table'[Part]=EARLIER('Table'[Part])&amp;amp;&amp;amp;'Table'[Material]=EARLIER('Table'[Material])))&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;(2) Create column Flag for the latest record&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;Flag = IF('Table'[date]='Table'[latestdate],1,0)&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;Latest record will be flagged as 1 like below&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&lt;img /&gt;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;Now, filter out the old record by filtering the flag &amp;lt;&amp;gt;0. Also fetch the cost of latest date by using filter context in CALCULATE function&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;Please let me know if this solutions works&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;DIV class="mceNonEditable lia-copypaste-placeholder"&gt;&amp;nbsp;&lt;/DIV&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;/DIV&gt;</description>
      <pubDate>Wed, 08 Jan 2020 10:56:45 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Multiply-colums-according-latest-date/m-p/893387#M7957</guid>
      <dc:creator>Parkavi</dc:creator>
      <dc:date>2020-01-08T10:56:45Z</dc:date>
    </item>
  </channel>
</rss>

