<?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 Flagging records that exist in 2 tables based on close date! in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Flagging-records-that-exist-in-2-tables-based-on-close-date/m-p/3055859#M156958</link>
    <description>&lt;P&gt;Hi All,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Scenario&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;I have 2 tables, where one tells me the expected sales return at the beginning of the month&lt;/P&gt;&lt;P&gt;and one where the actuals sales numbers are stored.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I want to see how much of the expected sales were actually made, this means I have to only sum up sales from the actual table that existed in the snapshot table on the 1sst of the month. I have correctly calculated the expected amount from the snapshot table.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The next step was to create a flag where I used the Lookup function to flag as 1 or 0 if the id from actuals was present in the snapshot table so I can filter on the records when I use a measure.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Desired Outcome&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;if I have 3 Closed Won sales with an asofdate = 01/01/2023 and a historical date within January 23 I would expect&amp;nbsp; to see those three sales only in my actual measure.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Problem&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;The above flag can only use id so it will not help me identify the sales in the period. Instead of getting 3 sales like the example above I get other sales too which exist in both tables.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Is there a way to flag sales that were expected to closed in month&amp;nbsp;to my actuals table so I only see sales completed that were expected and filter out sales opened and closed in month.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Table 1 has Information for sales as of the first day of the month and looks like the below&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;TABLE&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;ID&lt;/TD&gt;&lt;TD&gt;AS OF DATE&lt;/TD&gt;&lt;TD&gt;HISTORICAL CLOSE DATE&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;125&lt;/TD&gt;&lt;TD&gt;01/01/2023&lt;/TD&gt;&lt;TD&gt;01/01/2023&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;516&lt;/TD&gt;&lt;TD&gt;02/01/2023&lt;/TD&gt;&lt;TD&gt;02/01/2023&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;514&lt;/TD&gt;&lt;TD&gt;03/01/2023&lt;/TD&gt;&lt;TD&gt;06/12/2022&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;153&lt;/TD&gt;&lt;TD&gt;04/01/2023&lt;/TD&gt;&lt;TD&gt;04/01/2023&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;235&lt;/TD&gt;&lt;TD&gt;05/01/2023&lt;/TD&gt;&lt;TD&gt;05/01/2023&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;89&lt;/TD&gt;&lt;TD&gt;06/01/2023&lt;/TD&gt;&lt;TD&gt;09/02/2023&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;894&lt;/TD&gt;&lt;TD&gt;07/01/2023&lt;/TD&gt;&lt;TD&gt;10/02/2023&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;545&lt;/TD&gt;&lt;TD&gt;08/01/2023&lt;/TD&gt;&lt;TD&gt;11/02/2023&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;147&lt;/TD&gt;&lt;TD&gt;09/01/2023&lt;/TD&gt;&lt;TD&gt;04/12/2022&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;754&lt;/TD&gt;&lt;TD&gt;10/01/2023&lt;/TD&gt;&lt;TD&gt;05/12/2022&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;458&lt;/TD&gt;&lt;TD&gt;11/01/2023&lt;/TD&gt;&lt;TD&gt;06/12/2022&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Table 2 is a standard actuals table where I have put in a flag using a lookup function. this is the table where I will use a measure for a visual.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have tried to use power query to help but due to the model build it will not allow me to group/merge and I am currently trying to use a virtual table which is not quite there yet.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If you kept reading thanks ! hopefully I havent confused you &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;if you have any ideas on what I could do please let me know,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Wed, 01 Feb 2023 17:53:29 GMT</pubDate>
    <dc:creator>Jitmondo</dc:creator>
    <dc:date>2023-02-01T17:53:29Z</dc:date>
    <item>
      <title>Flagging records that exist in 2 tables based on close date!</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Flagging-records-that-exist-in-2-tables-based-on-close-date/m-p/3055859#M156958</link>
      <description>&lt;P&gt;Hi All,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Scenario&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;I have 2 tables, where one tells me the expected sales return at the beginning of the month&lt;/P&gt;&lt;P&gt;and one where the actuals sales numbers are stored.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I want to see how much of the expected sales were actually made, this means I have to only sum up sales from the actual table that existed in the snapshot table on the 1sst of the month. I have correctly calculated the expected amount from the snapshot table.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The next step was to create a flag where I used the Lookup function to flag as 1 or 0 if the id from actuals was present in the snapshot table so I can filter on the records when I use a measure.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Desired Outcome&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;if I have 3 Closed Won sales with an asofdate = 01/01/2023 and a historical date within January 23 I would expect&amp;nbsp; to see those three sales only in my actual measure.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Problem&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;The above flag can only use id so it will not help me identify the sales in the period. Instead of getting 3 sales like the example above I get other sales too which exist in both tables.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Is there a way to flag sales that were expected to closed in month&amp;nbsp;to my actuals table so I only see sales completed that were expected and filter out sales opened and closed in month.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Table 1 has Information for sales as of the first day of the month and looks like the below&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;TABLE&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;ID&lt;/TD&gt;&lt;TD&gt;AS OF DATE&lt;/TD&gt;&lt;TD&gt;HISTORICAL CLOSE DATE&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;125&lt;/TD&gt;&lt;TD&gt;01/01/2023&lt;/TD&gt;&lt;TD&gt;01/01/2023&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;516&lt;/TD&gt;&lt;TD&gt;02/01/2023&lt;/TD&gt;&lt;TD&gt;02/01/2023&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;514&lt;/TD&gt;&lt;TD&gt;03/01/2023&lt;/TD&gt;&lt;TD&gt;06/12/2022&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;153&lt;/TD&gt;&lt;TD&gt;04/01/2023&lt;/TD&gt;&lt;TD&gt;04/01/2023&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;235&lt;/TD&gt;&lt;TD&gt;05/01/2023&lt;/TD&gt;&lt;TD&gt;05/01/2023&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;89&lt;/TD&gt;&lt;TD&gt;06/01/2023&lt;/TD&gt;&lt;TD&gt;09/02/2023&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;894&lt;/TD&gt;&lt;TD&gt;07/01/2023&lt;/TD&gt;&lt;TD&gt;10/02/2023&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;545&lt;/TD&gt;&lt;TD&gt;08/01/2023&lt;/TD&gt;&lt;TD&gt;11/02/2023&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;147&lt;/TD&gt;&lt;TD&gt;09/01/2023&lt;/TD&gt;&lt;TD&gt;04/12/2022&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;754&lt;/TD&gt;&lt;TD&gt;10/01/2023&lt;/TD&gt;&lt;TD&gt;05/12/2022&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;458&lt;/TD&gt;&lt;TD&gt;11/01/2023&lt;/TD&gt;&lt;TD&gt;06/12/2022&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Table 2 is a standard actuals table where I have put in a flag using a lookup function. this is the table where I will use a measure for a visual.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have tried to use power query to help but due to the model build it will not allow me to group/merge and I am currently trying to use a virtual table which is not quite there yet.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If you kept reading thanks ! hopefully I havent confused you &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;if you have any ideas on what I could do please let me know,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 01 Feb 2023 17:53:29 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Flagging-records-that-exist-in-2-tables-based-on-close-date/m-p/3055859#M156958</guid>
      <dc:creator>Jitmondo</dc:creator>
      <dc:date>2023-02-01T17:53:29Z</dc:date>
    </item>
  </channel>
</rss>

