<?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: How to compare dates from two related tables and generate accuracy rate in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-compare-dates-from-two-related-tables-and-generate/m-p/3157361#M113280</link>
    <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="355401" data-lia-user-login="MattRo" class="lia-mention lia-mention-user"&gt;MattRo&lt;/a&gt; , You need have common MRN dimension, post that you need have measures &lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;measure =&lt;/P&gt;
&lt;P&gt;var _diff = datediff(max(Table1[DesChg]), max(Table2[Expected DesChg]), day)&lt;/P&gt;
&lt;P&gt;return&lt;/P&gt;
&lt;P&gt;countx(values(MRN[MRN]), if(_diff&amp;nbsp; &amp;lt;&amp;gt;0 , [MRN], blank() ) )&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Now you can divide ot with countrows(filter(Table, Table1[DesChg] &amp;lt;&amp;gt; Blank()))&lt;/P&gt;</description>
    <pubDate>Tue, 28 Mar 2023 02:08:30 GMT</pubDate>
    <dc:creator>amitchandak</dc:creator>
    <dc:date>2023-03-28T02:08:30Z</dc:date>
    <item>
      <title>How to compare dates from two related tables and generate accuracy rate</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-compare-dates-from-two-related-tables-and-generate/m-p/3157339#M113278</link>
      <description>&lt;P&gt;Hello. I work in a hospital and we want to compare the actual discharge date of a patient with accuracy of our estimate from earlier. I have two tables related (1:many) by a patient ID number (MRN).&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Table 1 - &lt;STRONG&gt;Yesterdays DCs&lt;/STRONG&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;&lt;STRONG&gt;MRN&lt;/STRONG&gt;&lt;/LI&gt;&lt;LI&gt;&lt;STRONG&gt;Disch Date&lt;/STRONG&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;Table 2 - &lt;STRONG&gt;DC Info&lt;/STRONG&gt; - This table give patient information on a daily basis. There are multiple/duplicate MRN in this table and I am interested in Expected Dischrg when Report Date/Time is &lt;EM&gt;latest&lt;/EM&gt;.&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;&lt;STRONG&gt;MRN&lt;/STRONG&gt;&lt;/LI&gt;&lt;LI&gt;&lt;STRONG&gt;Expected Dischrg&lt;/STRONG&gt;&lt;/LI&gt;&lt;LI&gt;&lt;STRONG&gt;Report Date/Time&lt;/STRONG&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;FONT size="4"&gt;&lt;STRONG&gt;Can you help me with a measure that will give the percentage of MRNs that have the correct Expected Dischrg date?&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Example:&lt;/P&gt;&lt;P&gt;Below, you can see, on 3/24, we discharged 9 patients where we had predicted they would discharge on 3/24. And there where 20 patients discharged where we had the estimate wrong.&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;Side note - Not to sidetrack, but a second question...I think the column above is misleading or wrong, "Latest Expected Dischrg" is not the same as "last reported" Expected Dischrg which would be more accturate.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you!&lt;/P&gt;</description>
      <pubDate>Tue, 28 Mar 2023 01:54:47 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-compare-dates-from-two-related-tables-and-generate/m-p/3157339#M113278</guid>
      <dc:creator>MattRo</dc:creator>
      <dc:date>2023-03-28T01:54:47Z</dc:date>
    </item>
    <item>
      <title>Re: How to compare dates from two related tables and generate accuracy rate</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-compare-dates-from-two-related-tables-and-generate/m-p/3157361#M113280</link>
      <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="355401" data-lia-user-login="MattRo" class="lia-mention lia-mention-user"&gt;MattRo&lt;/a&gt; , You need have common MRN dimension, post that you need have measures &lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;measure =&lt;/P&gt;
&lt;P&gt;var _diff = datediff(max(Table1[DesChg]), max(Table2[Expected DesChg]), day)&lt;/P&gt;
&lt;P&gt;return&lt;/P&gt;
&lt;P&gt;countx(values(MRN[MRN]), if(_diff&amp;nbsp; &amp;lt;&amp;gt;0 , [MRN], blank() ) )&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Now you can divide ot with countrows(filter(Table, Table1[DesChg] &amp;lt;&amp;gt; Blank()))&lt;/P&gt;</description>
      <pubDate>Tue, 28 Mar 2023 02:08:30 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-compare-dates-from-two-related-tables-and-generate/m-p/3157361#M113280</guid>
      <dc:creator>amitchandak</dc:creator>
      <dc:date>2023-03-28T02:08:30Z</dc:date>
    </item>
    <item>
      <title>Re: How to compare dates from two related tables and generate accuracy rate</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-compare-dates-from-two-related-tables-and-generate/m-p/3159316#M113411</link>
      <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="148838" data-lia-user-login="amitchandak" class="lia-mention lia-mention-user"&gt;amitchandak&lt;/a&gt;&amp;nbsp; Hi. Thanks for the response! Could you elaborate on "You need to have a common MRN dimension"? Do you mean I need to create a separate table containing MRN only? What would the purpose be given that I already have a table with a column of all unique MRN values? Thank you.&lt;/P&gt;</description>
      <pubDate>Tue, 28 Mar 2023 20:40:02 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-compare-dates-from-two-related-tables-and-generate/m-p/3159316#M113411</guid>
      <dc:creator>MattRo</dc:creator>
      <dc:date>2023-03-28T20:40:02Z</dc:date>
    </item>
    <item>
      <title>Re: How to compare dates from two related tables and generate accuracy rate</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-compare-dates-from-two-related-tables-and-generate/m-p/3159558#M113417</link>
      <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="148838" data-lia-user-login="amitchandak" class="lia-mention lia-mention-user"&gt;amitchandak&lt;/a&gt;&amp;nbsp;&lt;BR /&gt;Using your measure, I managed to come up with this which identifies the matches. I think I am on the right track, but I am not able to sum. Any ideas?&lt;/P&gt;&lt;P&gt;&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;using this measure:&lt;/P&gt;&lt;DIV&gt;&lt;DIV class="lia-indent-padding-left-30px"&gt;&lt;SPAN&gt;EDD Accurate? = &lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV class="lia-indent-padding-left-30px"&gt;&lt;SPAN&gt;var&lt;/SPAN&gt;&lt;SPAN&gt; _diff = &lt;/SPAN&gt;&lt;SPAN&gt;datediff&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;max&lt;/SPAN&gt;&lt;SPAN&gt;('Yesterday DCs'[Disch Date]), &lt;/SPAN&gt;&lt;SPAN&gt;max&lt;/SPAN&gt;&lt;SPAN&gt;('DC info'[Expected Dischrg]), day)&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV class="lia-indent-padding-left-30px"&gt;&lt;SPAN&gt;return&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV class="lia-indent-padding-left-30px"&gt;&lt;SPAN&gt;countx&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV class="lia-indent-padding-left-30px"&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &lt;/SPAN&gt;&lt;SPAN&gt;values&lt;/SPAN&gt;&lt;SPAN&gt;('Yesterday DCs'[MRN.DCd]), &lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV class="lia-indent-padding-left-30px"&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &lt;/SPAN&gt;&lt;SPAN&gt;if&lt;/SPAN&gt;&lt;SPAN&gt;(_diff &amp;nbsp;&amp;lt;&amp;gt;&lt;/SPAN&gt;&lt;SPAN&gt;0&lt;/SPAN&gt;&lt;SPAN&gt; , &lt;/SPAN&gt;&lt;SPAN&gt;blank&lt;/SPAN&gt;&lt;SPAN&gt;(), &lt;/SPAN&gt;&lt;SPAN&gt;1&lt;/SPAN&gt;&lt;SPAN&gt;) &lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV class="lia-indent-padding-left-30px"&gt;&lt;SPAN&gt;)&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/DIV&gt;</description>
      <pubDate>Wed, 29 Mar 2023 00:38:09 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-compare-dates-from-two-related-tables-and-generate/m-p/3159558#M113417</guid>
      <dc:creator>MattRo</dc:creator>
      <dc:date>2023-03-29T00:38:09Z</dc:date>
    </item>
  </channel>
</rss>

