<?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: repost: Wine Inventory in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/repost-Wine-Inventory/m-p/1428739#M26633</link>
    <description>&lt;P&gt;Thanks&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="61168" data-lia-user-login="themistoklis" class="lia-mention lia-mention-user"&gt;themistoklis&lt;/a&gt;! This helped alot! I also discovered that I could use the Datesbetween function to get the proper date range. Below is the formula for the measure that returned the correct value.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks again for your help!&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;=VAR _Last_Set_Date_In_Context = [Last Set Date In Context]&lt;BR /&gt;RETURN&lt;BR /&gt;SUMX(&lt;BR /&gt;WineList,&lt;BR /&gt;CALCULATE(&lt;BR /&gt;SUM( WineLog[Bottles] ) * -1,&lt;BR /&gt;WineLogtt[Transaction Type] = "Take",&lt;BR /&gt;DATESBETWEEN(&lt;BR /&gt;'Calendar'[Date],&lt;BR /&gt;_Last_Set_Date_In_Context,&lt;BR /&gt;MAX( 'Calendar'[Date] )&lt;BR /&gt;)&lt;BR /&gt;)&lt;BR /&gt;)&lt;/P&gt;</description>
    <pubDate>Mon, 12 Oct 2020 18:20:41 GMT</pubDate>
    <dc:creator>glennkobes</dc:creator>
    <dc:date>2020-10-12T18:20:41Z</dc:date>
    <item>
      <title>repost: Wine Inventory</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/repost-Wine-Inventory/m-p/1427522#M26599</link>
      <description>&lt;P&gt;Hi, This is a repost as I have not yet found a solution. &lt;A href="https://community.powerbi.com/t5/DAX-Commands-and-Tips/wine-inventory/m-p/1416164/highlight/true#M26322" target="_self"&gt;Orignal post&lt;/A&gt;.&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I also have the link to the file (&lt;A href="https://www.dropbox.com/s/fm6kib663cm4j8c/Winelog.xlsx?dl=0" target="_self"&gt;here&lt;/A&gt;). My main issue is that I have a measure to get the latest date for which there is a "Set" entry.&amp;nbsp;&lt;SPAN&gt;[Last Set Date In Context] returns 9/6/2017, which is what I expected. However, when I use that messure to return a running total, I do not get the expected result.&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;=SUMX(&lt;BR /&gt;WineList,&lt;BR /&gt;CALCULATE(&lt;BR /&gt;sum(WineLog[Bottles])*-1,&lt;BR /&gt;WineLog[Transaction Type] = "Take",&lt;BR /&gt;filter(all( 'Calendar'),'Calendar'[date] &amp;gt;= [Last Set Date In Context] )))&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;returns -7, which is not correct. However, if I hard code the date,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;=SUMX(&lt;BR /&gt;WineList,&lt;BR /&gt;CALCULATE(&lt;BR /&gt;sum(WineLog[Bottles])*-1,&lt;BR /&gt;WineLogtt[Transaction Type] = "Take",&lt;BR /&gt;filter( 'Calendar','Calendar'[date] &amp;gt;= date(2017,09,06 ))))&lt;BR /&gt;&lt;BR /&gt;This returns "-2", which is what I expect.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Any thoughts on what I am doing wrong? &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 12 Oct 2020 08:45:29 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/repost-Wine-Inventory/m-p/1427522#M26599</guid>
      <dc:creator>glennkobes</dc:creator>
      <dc:date>2020-10-12T08:45:29Z</dc:date>
    </item>
    <item>
      <title>Re: repost: Wine Inventory</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/repost-Wine-Inventory/m-p/1428016#M26612</link>
      <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="263169" data-lia-user-login="glennkobes" class="lia-mention lia-mention-user"&gt;glennkobes&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Make sure you assign the date in '&lt;SPAN&gt;Last Set Date In Context' field to a variable.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Then add the variable to the measure:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="php"&gt;Measure =
VAR _Last_Set_Date_In_Context = MAX(WineLog[Bottles])

RETURN
SUMX(
WineList,
CALCULATE(
sum(WineLog[Bottles])*-1,
WineLogtt[Transaction Type] = "Take",
filter( 'Calendar','Calendar'[date] &amp;gt;= _Last_Set_Date_In_Context)))&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 12 Oct 2020 11:42:03 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/repost-Wine-Inventory/m-p/1428016#M26612</guid>
      <dc:creator>themistoklis</dc:creator>
      <dc:date>2020-10-12T11:42:03Z</dc:date>
    </item>
    <item>
      <title>Re: repost: Wine Inventory</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/repost-Wine-Inventory/m-p/1428739#M26633</link>
      <description>&lt;P&gt;Thanks&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="61168" data-lia-user-login="themistoklis" class="lia-mention lia-mention-user"&gt;themistoklis&lt;/a&gt;! This helped alot! I also discovered that I could use the Datesbetween function to get the proper date range. Below is the formula for the measure that returned the correct value.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks again for your help!&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;=VAR _Last_Set_Date_In_Context = [Last Set Date In Context]&lt;BR /&gt;RETURN&lt;BR /&gt;SUMX(&lt;BR /&gt;WineList,&lt;BR /&gt;CALCULATE(&lt;BR /&gt;SUM( WineLog[Bottles] ) * -1,&lt;BR /&gt;WineLogtt[Transaction Type] = "Take",&lt;BR /&gt;DATESBETWEEN(&lt;BR /&gt;'Calendar'[Date],&lt;BR /&gt;_Last_Set_Date_In_Context,&lt;BR /&gt;MAX( 'Calendar'[Date] )&lt;BR /&gt;)&lt;BR /&gt;)&lt;BR /&gt;)&lt;/P&gt;</description>
      <pubDate>Mon, 12 Oct 2020 18:20:41 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/repost-Wine-Inventory/m-p/1428739#M26633</guid>
      <dc:creator>glennkobes</dc:creator>
      <dc:date>2020-10-12T18:20:41Z</dc:date>
    </item>
  </channel>
</rss>

