<?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: Calculate accumulated product sales ending expiry dates using Dax in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculate-accumulated-product-sales-ending-expiry-dates-using/m-p/3597762#M139020</link>
    <description>&lt;P&gt;Thanks for the measure. I just tested it and found the measure to be very restricted. If I create a duplicated column "calendar_month" in dim.date table and use the "calendar_month" instead of "calendar_month_key" column for the visual, the measure doesn't work.&amp;nbsp; The result is like this:&lt;BR /&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;Because I am going to replicate this measure in a more complex PBI report. I won't be able to restrict the visual to refer to one column only. It nees to allow flexibility of using different columns within a primary key table, could you please take a look and check if you can adjust the measure to allow such flexbility. Thank you! Pls find below the link to the updated PBI report.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;A title="Accumulated sales PBI report update" href="https://drive.google.com/file/d/1YZOVYpqHd4DnnIM_R89aPupUsZFeqCp_/view?usp=drive_link" target="_self"&gt;Accumulated sales PBI report update&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Thu, 21 Dec 2023 23:57:01 GMT</pubDate>
    <dc:creator>Jl7988</dc:creator>
    <dc:date>2023-12-21T23:57:01Z</dc:date>
    <item>
      <title>Calculate accumulated product sales ending expiry dates using Dax</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculate-accumulated-product-sales-ending-expiry-dates-using/m-p/3596399#M138949</link>
      <description>&lt;P&gt;I was trying to calculate accumulated sales ending expiry dates. The target is to calculate the accumulated sales till the month the product expires. I used a measure to calculate it. However it didn't work. Can any expert advise how the measure can be adjusted or re-developed to suit this scenario? Thanks very much! The link to the PBI report is below:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;A title="Accumulated sales PBI report" href="https://drive.google.com/file/d/1tUc5SFFPQGoeLF7dzWFsJpw_82UapnaA/view?usp=drive_link" target="_self"&gt;Accumulated sales PBI report&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have a list of products with the following expiry dates:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;TABLE border="1"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;&lt;P&gt;Product Code&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;Expiry Month&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;&lt;P&gt;A&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;202205&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;&lt;P&gt;B&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;202206&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;&lt;P&gt;C&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;202207&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;The sales by month for them are as follows:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;TABLE border="1"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;&lt;P&gt;Calendar month&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;Product Code&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&g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&gt;&lt;P&gt;202206&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;3000&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;3000&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;6000&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;&lt;P&gt;202207&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;4000&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;4000&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;</description>
      <pubDate>Thu, 21 Dec 2023 15:22:22 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculate-accumulated-product-sales-ending-expiry-dates-using/m-p/3596399#M138949</guid>
      <dc:creator>Jl7988</dc:creator>
      <dc:date>2023-12-21T15:22:22Z</dc:date>
    </item>
    <item>
      <title>Re: Calculate accumulated product sales ending expiry dates using Dax</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculate-accumulated-product-sales-ending-expiry-dates-using/m-p/3596412#M138951</link>
      <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="291628" data-lia-user-login="Jihwan_Kim" class="lia-mention lia-mention-user"&gt;Jihwan_Kim&lt;/a&gt;&amp;nbsp; Thanks for creating the initial measure. I was trying to use this measure to calculate accumulated sales but it didn't work. So I have to create a new post to seek further assistance. Appreciate it if you can have a look at it as well. Thank you!&lt;/P&gt;</description>
      <pubDate>Thu, 21 Dec 2023 10:37:27 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculate-accumulated-product-sales-ending-expiry-dates-using/m-p/3596412#M138951</guid>
      <dc:creator>Jl7988</dc:creator>
      <dc:date>2023-12-21T10:37:27Z</dc:date>
    </item>
    <item>
      <title>Re: Calculate accumulated product sales ending expiry dates using Dax</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculate-accumulated-product-sales-ending-expiry-dates-using/m-p/3596501#M138957</link>
      <description>&lt;P&gt;Hi,&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="657851" data-lia-user-login="Jl7988" class="lia-mention lia-mention-user"&gt;Jl7988&lt;/a&gt;&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;try below code&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;SUMX(
   FILTER( 
    CROSSJOIN( 
        ALL(Dim_Date[Calendar Month Key]),all(Dim_Expiry_Date[Expiry Month])
    ),
    Dim_Date[Calendar Month Key]&amp;lt;= MAX(Dim_Date[Calendar Month Key]) 
    &amp;amp;&amp;amp; Dim_Date[Calendar Month Key]&amp;lt;=Dim_Expiry_Date[Expiry Month]
    ),
    [amounts]
    )&lt;/LI-CODE&gt;</description>
      <pubDate>Thu, 21 Dec 2023 11:15:14 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculate-accumulated-product-sales-ending-expiry-dates-using/m-p/3596501#M138957</guid>
      <dc:creator>Dangar332</dc:creator>
      <dc:date>2023-12-21T11:15:14Z</dc:date>
    </item>
    <item>
      <title>Re: Calculate accumulated product sales ending expiry dates using Dax</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculate-accumulated-product-sales-ending-expiry-dates-using/m-p/3596651#M138963</link>
      <description>&lt;P&gt;Thanks. I tried your code but the results are not as expected. Below is the output&lt;BR /&gt;&lt;BR /&gt;&lt;img /&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 21 Dec 2023 12:07:25 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculate-accumulated-product-sales-ending-expiry-dates-using/m-p/3596651#M138963</guid>
      <dc:creator>Jl7988</dc:creator>
      <dc:date>2023-12-21T12:07:25Z</dc:date>
    </item>
    <item>
      <title>Re: Calculate accumulated product sales ending expiry dates using Dax</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculate-accumulated-product-sales-ending-expiry-dates-using/m-p/3597591#M139009</link>
      <description>&lt;P&gt;&lt;img /&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 21 Dec 2023 20:08:01 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculate-accumulated-product-sales-ending-expiry-dates-using/m-p/3597591#M139009</guid>
      <dc:creator>ThxAlot</dc:creator>
      <dc:date>2023-12-21T20:08:01Z</dc:date>
    </item>
    <item>
      <title>Re: Calculate accumulated product sales ending expiry dates using Dax</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculate-accumulated-product-sales-ending-expiry-dates-using/m-p/3597762#M139020</link>
      <description>&lt;P&gt;Thanks for the measure. I just tested it and found the measure to be very restricted. If I create a duplicated column "calendar_month" in dim.date table and use the "calendar_month" instead of "calendar_month_key" column for the visual, the measure doesn't work.&amp;nbsp; The result is like this:&lt;BR /&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;Because I am going to replicate this measure in a more complex PBI report. I won't be able to restrict the visual to refer to one column only. It nees to allow flexibility of using different columns within a primary key table, could you please take a look and check if you can adjust the measure to allow such flexbility. Thank you! Pls find below the link to the updated PBI report.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;A title="Accumulated sales PBI report update" href="https://drive.google.com/file/d/1YZOVYpqHd4DnnIM_R89aPupUsZFeqCp_/view?usp=drive_link" target="_self"&gt;Accumulated sales PBI report update&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 21 Dec 2023 23:57:01 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculate-accumulated-product-sales-ending-expiry-dates-using/m-p/3597762#M139020</guid>
      <dc:creator>Jl7988</dc:creator>
      <dc:date>2023-12-21T23:57:01Z</dc:date>
    </item>
  </channel>
</rss>

