<?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: average of tables with no relationships in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/average-of-tables-with-no-relationships/m-p/2317031#M57754</link>
    <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="355778" data-lia-user-login="rkubis" class="lia-mention lia-mention-user"&gt;rkubis&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;
&lt;P&gt;I download your sample,&amp;nbsp;the sale date and usage date columns in sales table and plan table are the same, so the two tables can be merged into one.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Here's my solution.&lt;/P&gt;
&lt;P&gt;1. In Power Query, click Merge Queries tab under Home ribbon.&lt;/P&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;P&gt;2. Select usage date and sale date columns of the two tables at the same time, then click OK.&lt;/P&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;P&gt;3.Get the following result, then click "Table" tab.&lt;/P&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;P&gt;Only select sales column.&lt;/P&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;P&gt;4.Get the following merged table.&lt;/P&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;P&gt;5. Create a measure.&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;sales RT vs total plan = 
VAR _salesRT =
    CALCULATE (
        SUM ( 'plan'[sales] ),
        FILTER (
            ALLSELECTED ( 'plan' ),
            ISONORAFTER ( 'plan'[sale date], MAX ( 'plan'[sale date] ), DESC )
        )
    )
VAR _TotalPlan =
    CALCULATE ( SUM ( 'plan'[plan] ), ALLSELECTED ( 'plan' ) )
RETURN
    DIVIDE ( _salesRT, _TotalPlan )&lt;/LI-CODE&gt;
&lt;P&gt;6.Get the result.&lt;/P&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;P&gt;I attach my sample below for reference.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Best Regards,&lt;BR /&gt;Community Support Team _ kalyj&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If this post&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;STRONG&gt;&lt;EM&gt;helps&lt;/EM&gt;&lt;/STRONG&gt;, then please consider&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;STRONG&gt;&lt;EM&gt;Accept it as the solution&lt;/EM&gt;&lt;/STRONG&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;to help the other members find it more quickly.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Thu, 03 Feb 2022 07:03:44 GMT</pubDate>
    <dc:creator>v-yanjiang-msft</dc:creator>
    <dc:date>2022-02-03T07:03:44Z</dc:date>
    <item>
      <title>average of tables with no relationships</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/average-of-tables-with-no-relationships/m-p/2311433#M57458</link>
      <description>&lt;P&gt;Hi ,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have a normal fact tables - plan and sales with usage dates and sale dates.I created additional column which is calculating usage_date-sale_date and this integer is than connected to separate table.&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have created running total of sales , total plan for each usage_date than divide those 2 values. So far so good. But what I am struggeling is to create averate of those values for for each (usage_date-sale_date) since those 2 tables are not connected.&amp;nbsp;&lt;/P&gt;&lt;P&gt;I thought to create separate summarize tables than union them than create another summarize of new union table but its not possible. I know I have to use summarize and at the end averagex of that table but I dont know how&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;I have attached sample data and sample pbix.&lt;/P&gt;&lt;P&gt;&lt;A href="https://tmrsk-my.sharepoint.com/:x:/g/personal/rkubis_tmr_sk/ERg8JvqZvXlEtVBiJ_k36ksBnothFHuFgmKpg96983SNIw?e=oaUT5f" target="_blank" rel="noopener"&gt;excel&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;A href="https://tmrsk-my.sharepoint.com/:u:/g/personal/rkubis_tmr_sk/EbxsrNL0GUROiEtdkcGqrwUBy3_eREjjdk3nw5AgvVIE4w?e=an2568" target="_self"&gt;pbix&lt;/A&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 31 Jan 2022 17:17:56 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/average-of-tables-with-no-relationships/m-p/2311433#M57458</guid>
      <dc:creator>rkubis</dc:creator>
      <dc:date>2022-01-31T17:17:56Z</dc:date>
    </item>
    <item>
      <title>Re: average of tables with no relationships</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/average-of-tables-with-no-relationships/m-p/2312963#M57553</link>
      <description>&lt;P&gt;Are you guys able to download the files ?&lt;/P&gt;&lt;P&gt;thanks&lt;/P&gt;</description>
      <pubDate>Tue, 01 Feb 2022 12:36:15 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/average-of-tables-with-no-relationships/m-p/2312963#M57553</guid>
      <dc:creator>rkubis</dc:creator>
      <dc:date>2022-02-01T12:36:15Z</dc:date>
    </item>
    <item>
      <title>Re: average of tables with no relationships</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/average-of-tables-with-no-relationships/m-p/2317031#M57754</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="355778" data-lia-user-login="rkubis" class="lia-mention lia-mention-user"&gt;rkubis&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;
&lt;P&gt;I download your sample,&amp;nbsp;the sale date and usage date columns in sales table and plan table are the same, so the two tables can be merged into one.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Here's my solution.&lt;/P&gt;
&lt;P&gt;1. In Power Query, click Merge Queries tab under Home ribbon.&lt;/P&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;P&gt;2. Select usage date and sale date columns of the two tables at the same time, then click OK.&lt;/P&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;P&gt;3.Get the following result, then click "Table" tab.&lt;/P&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;P&gt;Only select sales column.&lt;/P&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;P&gt;4.Get the following merged table.&lt;/P&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;P&gt;5. Create a measure.&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;sales RT vs total plan = 
VAR _salesRT =
    CALCULATE (
        SUM ( 'plan'[sales] ),
        FILTER (
            ALLSELECTED ( 'plan' ),
            ISONORAFTER ( 'plan'[sale date], MAX ( 'plan'[sale date] ), DESC )
        )
    )
VAR _TotalPlan =
    CALCULATE ( SUM ( 'plan'[plan] ), ALLSELECTED ( 'plan' ) )
RETURN
    DIVIDE ( _salesRT, _TotalPlan )&lt;/LI-CODE&gt;
&lt;P&gt;6.Get the result.&lt;/P&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;P&gt;I attach my sample below for reference.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Best Regards,&lt;BR /&gt;Community Support Team _ kalyj&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If this post&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;STRONG&gt;&lt;EM&gt;helps&lt;/EM&gt;&lt;/STRONG&gt;, then please consider&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;STRONG&gt;&lt;EM&gt;Accept it as the solution&lt;/EM&gt;&lt;/STRONG&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;to help the other members find it more quickly.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 03 Feb 2022 07:03:44 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/average-of-tables-with-no-relationships/m-p/2317031#M57754</guid>
      <dc:creator>v-yanjiang-msft</dc:creator>
      <dc:date>2022-02-03T07:03:44Z</dc:date>
    </item>
    <item>
      <title>Re: average of tables with no relationships</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/average-of-tables-with-no-relationships/m-p/2323552#M58090</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="334520" data-lia-user-login="v-yanjiang-msft" class="lia-mention lia-mention-user"&gt;v-yanjiang-msft&lt;/a&gt;&amp;nbsp;, I am looking for DAX solution since the Ski_date-sale_date table is created on the fly using DAX.&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have much more tables joining via this table so using powerquery is not really a solution.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;anyway thank you&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;thank you&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 07 Feb 2022 16:12:03 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/average-of-tables-with-no-relationships/m-p/2323552#M58090</guid>
      <dc:creator>rkubis</dc:creator>
      <dc:date>2022-02-07T16:12:03Z</dc:date>
    </item>
  </channel>
</rss>

