<?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: Pulling a value from a calculated date in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Pulling-a-value-from-a-calculated-date/m-p/2548458#M72053</link>
    <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="76973" data-lia-user-login="drivas771994" class="lia-mention lia-mention-user"&gt;drivas771994&lt;/a&gt;&amp;nbsp;Perhaps:&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;Measure =
  VAR __dateweight = MAX('SPARTA_SCANS2'[Date])
  VAR __Athlete = MAX('SPARTA_SCANS2'[Athlete])
  VAR __BMDate = FILTER('TESTS',[Athlete] = __Athlete &amp;amp;&amp;amp; [Date] &amp;gt;= __dateweight ),[Date])
RETURN
  MAXX(FILTER('TESTS',[Athlete] = __Athlete &amp;amp;&amp;amp; [Date] = __BMDdate),[Value])&lt;/LI-CODE&gt;
&lt;P&gt;Sorry, having trouble following, can you post sample data as text and expected output?&lt;BR /&gt;Not really enough information to go on, please first check if your issue is a common issue listed here: &lt;A href="https://community.powerbi.com/t5/Community-Blog/Before-You-Post-Read-This/ba-p/1116882" target="_blank"&gt;https://community.powerbi.com/t5/Community-Blog/Before-You-Post-Read-This/ba-p/1116882&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;Also, please see this post regarding How to Get Your Question Answered Quickly: &lt;A href="https://community.powerbi.com/t5/Community-Blog/How-to-Get-Your-Question-Answered-Quickly/ba-p/38490" target="_blank"&gt;https://community.powerbi.com/t5/Community-Blog/How-to-Get-Your-Question-Answered-Quickly/ba-p/38490&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;The most important parts are:&lt;BR /&gt;1. Sample data as text, use the table tool in the editing bar&lt;BR /&gt;2. Expected output from sample data&lt;BR /&gt;3. Explanation in words of how to get from 1. to 2.&lt;/P&gt;</description>
    <pubDate>Mon, 30 May 2022 20:40:18 GMT</pubDate>
    <dc:creator>Greg_Deckler</dc:creator>
    <dc:date>2022-05-30T20:40:18Z</dc:date>
    <item>
      <title>Pulling a value from a calculated date</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Pulling-a-value-from-a-calculated-date/m-p/2548451#M72050</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm trying to compare some bodyweights to some strength exercises and am having trouble pulling the bodyweight from a seperate table. I currently have two tables. One with bodyweights from weigh ins and one with exercise data. I've gotten my formula to find the most recent date but don't know how to pull the actual weight from that day's weigh in.&amp;nbsp; Can someone help me? The test value is the exercise data and I just need the body mass associated with the date listed in the table&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Here is the current formula I have:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;Most Recent Body Mass = &lt;/SPAN&gt;&lt;/DIV&gt;&lt;BR /&gt;&lt;DIV&gt;&lt;SPAN&gt;var&lt;/SPAN&gt; &lt;SPAN&gt;dateweight&lt;/SPAN&gt;&lt;SPAN&gt;=&lt;/SPAN&gt;&lt;SPAN&gt;selectedvalue&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;SPARTA_SCANS2[Date]&lt;/SPAN&gt;&lt;SPAN&gt;)&lt;/SPAN&gt;&lt;/DIV&gt;&lt;BR /&gt;&lt;DIV&gt;&lt;SPAN&gt;return&lt;/SPAN&gt;&lt;/DIV&gt;&lt;BR /&gt;&lt;DIV&gt;&lt;SPAN&gt;calculate&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;min&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;TESTS[Date]&lt;/SPAN&gt;&lt;SPAN&gt;), &lt;/SPAN&gt;&lt;SPAN&gt;TESTS[Date]&lt;/SPAN&gt;&lt;SPAN&gt;&amp;gt;=&lt;/SPAN&gt;&lt;SPAN&gt;dateweight&lt;/SPAN&gt;&lt;SPAN&gt;)&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;Also here is the view of it in my table.&amp;nbsp;&lt;img /&gt;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/DIV&gt;</description>
      <pubDate>Mon, 30 May 2022 20:31:00 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Pulling-a-value-from-a-calculated-date/m-p/2548451#M72050</guid>
      <dc:creator>drivas771994</dc:creator>
      <dc:date>2022-05-30T20:31:00Z</dc:date>
    </item>
    <item>
      <title>Re: Pulling a value from a calculated date</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Pulling-a-value-from-a-calculated-date/m-p/2548458#M72053</link>
      <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="76973" data-lia-user-login="drivas771994" class="lia-mention lia-mention-user"&gt;drivas771994&lt;/a&gt;&amp;nbsp;Perhaps:&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;Measure =
  VAR __dateweight = MAX('SPARTA_SCANS2'[Date])
  VAR __Athlete = MAX('SPARTA_SCANS2'[Athlete])
  VAR __BMDate = FILTER('TESTS',[Athlete] = __Athlete &amp;amp;&amp;amp; [Date] &amp;gt;= __dateweight ),[Date])
RETURN
  MAXX(FILTER('TESTS',[Athlete] = __Athlete &amp;amp;&amp;amp; [Date] = __BMDdate),[Value])&lt;/LI-CODE&gt;
&lt;P&gt;Sorry, having trouble following, can you post sample data as text and expected output?&lt;BR /&gt;Not really enough information to go on, please first check if your issue is a common issue listed here: &lt;A href="https://community.powerbi.com/t5/Community-Blog/Before-You-Post-Read-This/ba-p/1116882" target="_blank"&gt;https://community.powerbi.com/t5/Community-Blog/Before-You-Post-Read-This/ba-p/1116882&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;Also, please see this post regarding How to Get Your Question Answered Quickly: &lt;A href="https://community.powerbi.com/t5/Community-Blog/How-to-Get-Your-Question-Answered-Quickly/ba-p/38490" target="_blank"&gt;https://community.powerbi.com/t5/Community-Blog/How-to-Get-Your-Question-Answered-Quickly/ba-p/38490&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;The most important parts are:&lt;BR /&gt;1. Sample data as text, use the table tool in the editing bar&lt;BR /&gt;2. Expected output from sample data&lt;BR /&gt;3. Explanation in words of how to get from 1. to 2.&lt;/P&gt;</description>
      <pubDate>Mon, 30 May 2022 20:40:18 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Pulling-a-value-from-a-calculated-date/m-p/2548458#M72053</guid>
      <dc:creator>Greg_Deckler</dc:creator>
      <dc:date>2022-05-30T20:40:18Z</dc:date>
    </item>
    <item>
      <title>Re: Pulling a value from a calculated date</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Pulling-a-value-from-a-calculated-date/m-p/2548494#M72054</link>
      <description>&lt;P&gt;Greg,&lt;/P&gt;&lt;P&gt;Here's a sample dataset:&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;Athlete Name&lt;/TD&gt;&lt;TD&gt;Test Date&lt;/TD&gt;&lt;TD&gt;Test Value&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;Most Recent Body Mass Date&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;&lt;FONT color="#FF0000"&gt;Most Recent Body Mass&lt;/FONT&gt;&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;&lt;P&gt;Athlete 1&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;12/1/2021&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;100&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;12/7/2021&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;&lt;FONT color="#FF0000"&gt;64KG&lt;/FONT&gt;&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;&lt;P&gt;Athlete 1&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;2/1/2022&lt;/TD&gt;&lt;TD&gt;105&lt;/TD&gt;&lt;TD&gt;2/7/2021&lt;/TD&gt;&lt;TD&gt;&lt;FONT color="#FF0000"&gt;66KG&lt;/FONT&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;&lt;P&gt;Athlete 1&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;4/1/2022&lt;/TD&gt;&lt;TD&gt;110&lt;/TD&gt;&lt;TD&gt;3/27/20&lt;/TD&gt;&lt;TD&gt;&lt;FONT color="#FF0000"&gt;68KG&lt;/FONT&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 red highlighted values are my expected output. Testing values exist in my "test" table and my bodyweights exist in my scans table. They don't always occur on the same date and i'd like power bi to find the closest bodyweight to the testing date. Sorry I'm pretty new to this&lt;/P&gt;</description>
      <pubDate>Mon, 30 May 2022 21:46:02 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Pulling-a-value-from-a-calculated-date/m-p/2548494#M72054</guid>
      <dc:creator>drivas771994</dc:creator>
      <dc:date>2022-05-30T21:46:02Z</dc:date>
    </item>
  </channel>
</rss>

