<?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: Compute total inventory value irrespective of the transactions on any given day in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Compute-total-inventory-value-irrespective-of-the-transactions/m-p/1291570#M22220</link>
    <description>&lt;LI-CODE lang="csharp"&gt;// If you store everything in
// one table T...
// this will give you the value
// on the last visible day
// in the current context.

[Total Value] =
var __lastVisibleDay =
    MAX( T[Date] )
var __result =
    SUMX(
        VALUES( T[Item] ),
        MAXX(
            TOPN(1,
                CALCULATETABLE(
                    T,
                    T[Date] &amp;lt;= __lastVisibleDay,
                    ALL( T[Date] )
                ),
                T[Date],
                DESC
            ),
            T[Value]
        )
    )
return
    __result&lt;/LI-CODE&gt;</description>
    <pubDate>Wed, 12 Aug 2020 20:03:16 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2020-08-12T20:03:16Z</dc:date>
    <item>
      <title>Compute total inventory value irrespective of the transactions on any given day</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Compute-total-inventory-value-irrespective-of-the-transactions/m-p/1291368#M22203</link>
      <description>&lt;P&gt;There are X number of items(For eg: A,B,C) being managed in the records of the inventory. For any given date the record in the database is only available for those items that were affected due to sale or purchase transaction.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The goal is to produce this report for any given date which is the total value of inventory irrespective of any transaction on that day.&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;In order to arrive at this it will be necessary to compute value of each item irrespective of the transaction on that date:&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;I need help with the dax query to achieve the above goal.&lt;/P&gt;&lt;P&gt;Thanks.&lt;/P&gt;</description>
      <pubDate>Wed, 12 Aug 2020 18:30:07 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Compute-total-inventory-value-irrespective-of-the-transactions/m-p/1291368#M22203</guid>
      <dc:creator>nidhi_ifi</dc:creator>
      <dc:date>2020-08-12T18:30:07Z</dc:date>
    </item>
    <item>
      <title>Re: Compute total inventory value irrespective of the transactions on any given day</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Compute-total-inventory-value-irrespective-of-the-transactions/m-p/1291570#M22220</link>
      <description>&lt;LI-CODE lang="csharp"&gt;// If you store everything in
// one table T...
// this will give you the value
// on the last visible day
// in the current context.

[Total Value] =
var __lastVisibleDay =
    MAX( T[Date] )
var __result =
    SUMX(
        VALUES( T[Item] ),
        MAXX(
            TOPN(1,
                CALCULATETABLE(
                    T,
                    T[Date] &amp;lt;= __lastVisibleDay,
                    ALL( T[Date] )
                ),
                T[Date],
                DESC
            ),
            T[Value]
        )
    )
return
    __result&lt;/LI-CODE&gt;</description>
      <pubDate>Wed, 12 Aug 2020 20:03:16 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Compute-total-inventory-value-irrespective-of-the-transactions/m-p/1291570#M22220</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2020-08-12T20:03:16Z</dc:date>
    </item>
    <item>
      <title>Re: Compute total inventory value irrespective of the transactions on any given day</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Compute-total-inventory-value-irrespective-of-the-transactions/m-p/1293118#M22270</link>
      <description>&lt;P&gt;The solution gives the sum of the values for the items whose transactions have taken place on a particular day. It does not include the items that did not have any transactions on that day. The goal is to compute the total value of the inventory covering all items irrespective of whether they were transacted on the given day. Please refer the example from the images.&lt;/P&gt;</description>
      <pubDate>Thu, 13 Aug 2020 10:02:59 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Compute-total-inventory-value-irrespective-of-the-transactions/m-p/1293118#M22270</guid>
      <dc:creator>nidhi_ifi</dc:creator>
      <dc:date>2020-08-13T10:02:59Z</dc:date>
    </item>
    <item>
      <title>Re: Compute total inventory value irrespective of the transactions on any given day</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Compute-total-inventory-value-irrespective-of-the-transactions/m-p/1293145#M22271</link>
      <description>Just change VALUES( T[Item] ) to ALL( T[Item] ) and you'll get what you want.</description>
      <pubDate>Thu, 13 Aug 2020 10:18:39 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Compute-total-inventory-value-irrespective-of-the-transactions/m-p/1293145#M22271</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2020-08-13T10:18:39Z</dc:date>
    </item>
  </channel>
</rss>

