<?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: Alternative for RELATED function in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Alternative-for-RELATED-function/m-p/1004272#M12759</link>
    <description>&lt;P&gt;Hi&amp;nbsp;Anonymous&lt;/LI-USER&gt;&amp;nbsp;,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Have you tried looking into LOOKUPVALUE dax function?&lt;/P&gt;&lt;P&gt;&lt;A href="https://docs.microsoft.com/en-us/dax/lookupvalue-function-dax" target="_blank"&gt;https://docs.microsoft.com/en-us/dax/lookupvalue-function-dax&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;EM&gt;If this helps and resolves the issue, appreciate a Kudos and mark it as a Solution! &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/EM&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Pragati&lt;/P&gt;</description>
    <pubDate>Thu, 02 Apr 2020 08:36:24 GMT</pubDate>
    <dc:creator>Pragati11</dc:creator>
    <dc:date>2020-04-02T08:36:24Z</dc:date>
    <item>
      <title>Alternative for RELATED function</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Alternative-for-RELATED-function/m-p/1003393#M12747</link>
      <description>&lt;P&gt;In the simplest sense I have two tables as follows.&amp;nbsp; Live Data is as it sounds, records with current data.&amp;nbsp; History takes a snapshot of open records on the first of each month.&lt;/P&gt;&lt;P&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&lt;/TD&gt;&lt;TD&gt;2/1/2020&lt;/TD&gt;&lt;TD&gt;CREATED&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;3&lt;/TD&gt;&lt;TD&gt;N&lt;/TD&gt;&lt;TD&gt;2/1/2020&lt;/TD&gt;&lt;TD&gt;CREATED&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;3&lt;/TD&gt;&lt;TD&gt;N&lt;/TD&gt;&lt;TD&gt;3/1/2020&lt;/TD&gt;&lt;TD&gt;INPROG&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The tables are joined on ID &amp;amp; Location.&amp;nbsp; ID is the active relationship.&amp;nbsp; Location relationship is used to find records for new locations (i.e. not in the last snapshot).&amp;nbsp; I should also mention that there is also a calendar table that is joined to History table.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am trying to add a Calculated Column in Live table that is equivalent to RELATED('History'[Status]) so that when I filter on a specific 'History'[Date] (naturally, throuh my Calendar date) that I get the Status that is applicable.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I understand why that doesn't work but have not found a suitable substitute.&amp;nbsp; I was able to build this as a RELATED workaround for my Location issue but have not been able to adapt it to the Status.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;Historical Location? = &lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;IF (&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;CALCULATE ( DISTINCTCOUNT(&lt;/SPAN&gt;&lt;SPAN&gt;'History'[Location],&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; FILTER('History','History'[Date] = LASTDATE('Calendar'[Date]) &amp;amp;&amp;amp; 'Live'[Location] = 'History'[Location])&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; ) &amp;gt; 0,&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;"Y",&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;"N"&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;)&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;/DIV&gt;</description>
      <pubDate>Wed, 01 Apr 2020 19:43:25 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Alternative-for-RELATED-function/m-p/1003393#M12747</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2020-04-01T19:43:25Z</dc:date>
    </item>
    <item>
      <title>Re: Alternative for RELATED function</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Alternative-for-RELATED-function/m-p/1004271#M12758</link>
      <description>&lt;P&gt;I would approach it differently. I would append live and history into a single fact table. Add a new column called status (or what ever) that stores either Live or History. &amp;nbsp; I would then create dimension tables for iD, loc. and date. I assume history date is the extract date, so you would end up with potentially 2 date columns. Add the current date for the live data.&amp;nbsp;&lt;/P&gt;&lt;P&gt;This will create&amp;nbsp;a simple star schema, and the DAX should be easier.&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;current records = calculate(countrows(data),data[status]="Live")&lt;/P&gt;&lt;P&gt;history records = calculate(countrows(data),data[status]="History")&lt;/P&gt;&lt;P&gt;etc&lt;/P&gt;</description>
      <pubDate>Thu, 02 Apr 2020 08:35:57 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Alternative-for-RELATED-function/m-p/1004271#M12758</guid>
      <dc:creator>MattAllington</dc:creator>
      <dc:date>2020-04-02T08:35:57Z</dc:date>
    </item>
    <item>
      <title>Re: Alternative for RELATED function</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Alternative-for-RELATED-function/m-p/1004272#M12759</link>
      <description>&lt;P&gt;Hi&amp;nbsp;Anonymous&lt;/LI-USER&gt;&amp;nbsp;,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Have you tried looking into LOOKUPVALUE dax function?&lt;/P&gt;&lt;P&gt;&lt;A href="https://docs.microsoft.com/en-us/dax/lookupvalue-function-dax" target="_blank"&gt;https://docs.microsoft.com/en-us/dax/lookupvalue-function-dax&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;EM&gt;If this helps and resolves the issue, appreciate a Kudos and mark it as a Solution! &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/EM&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Pragati&lt;/P&gt;</description>
      <pubDate>Thu, 02 Apr 2020 08:36:24 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Alternative-for-RELATED-function/m-p/1004272#M12759</guid>
      <dc:creator>Pragati11</dc:creator>
      <dc:date>2020-04-02T08:36:24Z</dc:date>
    </item>
    <item>
      <title>Re: Alternative for RELATED function</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Alternative-for-RELATED-function/m-p/1045131#M14093</link>
      <description>&lt;P&gt;&amp;nbsp;Thanks for that but LOOKUPVALUE hasn't been any help.&amp;nbsp; I there is a cautionary note in&amp;nbsp;&lt;U&gt;The Definitive Guide to DAX &lt;/U&gt;that explains the reason why it's not my solution.&amp;nbsp; The note basically says that LOOKUPVALUE ignores existing filter context.&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Since I want/need the calendar dates to be in play here I can't use LOOKUPVALUE.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 23 Apr 2020 18:02:28 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Alternative-for-RELATED-function/m-p/1045131#M14093</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2020-04-23T18:02:28Z</dc:date>
    </item>
  </channel>
</rss>

