<?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 Converting 3 steps table to only one table in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Converting-3-steps-table-to-only-one-table/m-p/2161061#M49959</link>
    <description>&lt;P&gt;Hi, I am new to DAX and I have an assignment which requires me to simplify all 3 steps table to only one table, preferably using&amp;nbsp;&lt;STRONG&gt;CALCULATETABLE function&lt;/STRONG&gt;.&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;Been trying this for almost 2 weeks now, still can't seem to get the idea.&lt;BR /&gt;Does anyone know how I can simplify these steps to only one table?&lt;/P&gt;&lt;P&gt;Thank you&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Table 1:&lt;/P&gt;&lt;PRE&gt;forecasting_uoa_transactions_step1 = 
    FILTER (  
        SUMMARIZE ( 
            uoa_transactions_history, 
            uoa_transactions_history[Date], 
            uoa_transactions_history[Country], 
            "UoA", SUM(uoa_transactions_history[Total Changes])
        ),  
        DATEDIFF(uoa_transactions_history[Date],TODAY(),MONTH)&amp;lt;variable_uoa_per_cust_window[Variable_UoA_per_Cust_Window Value]+1
    )&lt;/PRE&gt;&lt;P&gt;Table 2:&lt;/P&gt;&lt;PRE&gt;forecasting_uoa_transactions_step2 = 
    SUMMARIZE ( 
        forecasting_uoa_transactions_step1, 
        forecasting_uoa_transactions_step1[Country],
        "UoA Per Customer Average", AVERAGE(forecasting_uoa_transactions_step1[UoA_per_Customer])
    )&lt;/PRE&gt;&lt;P&gt;Table 3:&lt;/P&gt;&lt;PRE&gt;forecasting_uoa_transactions_step3 = 
    SELECTCOLUMNS ( 
        customer_transactions_forecast,
        "Date", customer_transactions_forecast[YearMonth],
        "Country", customer_transactions_forecast[Country],
        "Customers", customer_transactions_forecast[Total Headcount]
    )&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Thu, 28 Oct 2021 14:52:35 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2021-10-28T14:52:35Z</dc:date>
    <item>
      <title>Converting 3 steps table to only one table</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Converting-3-steps-table-to-only-one-table/m-p/2161061#M49959</link>
      <description>&lt;P&gt;Hi, I am new to DAX and I have an assignment which requires me to simplify all 3 steps table to only one table, preferably using&amp;nbsp;&lt;STRONG&gt;CALCULATETABLE function&lt;/STRONG&gt;.&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;Been trying this for almost 2 weeks now, still can't seem to get the idea.&lt;BR /&gt;Does anyone know how I can simplify these steps to only one table?&lt;/P&gt;&lt;P&gt;Thank you&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Table 1:&lt;/P&gt;&lt;PRE&gt;forecasting_uoa_transactions_step1 = 
    FILTER (  
        SUMMARIZE ( 
            uoa_transactions_history, 
            uoa_transactions_history[Date], 
            uoa_transactions_history[Country], 
            "UoA", SUM(uoa_transactions_history[Total Changes])
        ),  
        DATEDIFF(uoa_transactions_history[Date],TODAY(),MONTH)&amp;lt;variable_uoa_per_cust_window[Variable_UoA_per_Cust_Window Value]+1
    )&lt;/PRE&gt;&lt;P&gt;Table 2:&lt;/P&gt;&lt;PRE&gt;forecasting_uoa_transactions_step2 = 
    SUMMARIZE ( 
        forecasting_uoa_transactions_step1, 
        forecasting_uoa_transactions_step1[Country],
        "UoA Per Customer Average", AVERAGE(forecasting_uoa_transactions_step1[UoA_per_Customer])
    )&lt;/PRE&gt;&lt;P&gt;Table 3:&lt;/P&gt;&lt;PRE&gt;forecasting_uoa_transactions_step3 = 
    SELECTCOLUMNS ( 
        customer_transactions_forecast,
        "Date", customer_transactions_forecast[YearMonth],
        "Country", customer_transactions_forecast[Country],
        "Customers", customer_transactions_forecast[Total Headcount]
    )&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 28 Oct 2021 14:52:35 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Converting-3-steps-table-to-only-one-table/m-p/2161061#M49959</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2021-10-28T14:52:35Z</dc:date>
    </item>
    <item>
      <title>Re: Converting 3 steps table to only one table</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Converting-3-steps-table-to-only-one-table/m-p/2164079#M50076</link>
      <description>&lt;P&gt;Table 3 seems to be unrelated to the first two steps.&amp;nbsp; Please validate your request.&lt;/P&gt;</description>
      <pubDate>Sat, 30 Oct 2021 00:44:22 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Converting-3-steps-table-to-only-one-table/m-p/2164079#M50076</guid>
      <dc:creator>lbendlin</dc:creator>
      <dc:date>2021-10-30T00:44:22Z</dc:date>
    </item>
    <item>
      <title>Re: Converting 3 steps table to only one table</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Converting-3-steps-table-to-only-one-table/m-p/2173826#M50537</link>
      <description>&lt;P&gt;Hi,&amp;nbsp;&lt;/P&gt;
&lt;P&gt;According to your description and DAX formulas, I can roughly understand your requirement, I think you can use VAR to define the above two calculated tables as virtual tables to achieve the result in one single DAX formula, you can try to create a calculated table like this:&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;forecasting_uoa_transactions=
VAR  _step1 =
    FILTER ( 
        SUMMARIZE (
            uoa_transactions_history,
            uoa_transactions_history[Date],
            uoa_transactions_history[Country],
            "UoA", SUM(uoa_transactions_history[Total Changes])
        ), 
        DATEDIFF(uoa_transactions_history[Date],TODAY(),MONTH)&amp;lt;variable_uoa_per_cust_window[Variable_UoA_per_Cust_Window Value]+1
)
VAR  _step2 =
    SUMMARIZE (
        _step1,
        [Country],
        "UoA Per Customer Average", AVERAGE( [UoA_per_Customer])
    )
RETURN
SELECTCOLUMNS (
        _step2,
        "Date", [YearMonth],
        "Country", [Country],
        "Customers", [Total Headcount]
    )&lt;/LI-CODE&gt;
&lt;P&gt;And you can get what you want.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If this result is not what you want, you can post some sample data(without sensitive data) and your expected result.&lt;/P&gt;
&lt;P&gt;&lt;A href="http://community.powerbi.com/t5/Community-Blog/How-to-Get-Your-Question-Answered-Quickly/ba-p/38490" target="_blank"&gt;How to Get Your Question Answered Quickly&amp;nbsp;&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;Thank you very much!&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Best Regards,&lt;/P&gt;
&lt;P&gt;Community Support Team _Robert Qin&lt;/P&gt;
&lt;P&gt;If this post &lt;STRONG&gt;helps&lt;/STRONG&gt;, then please consider &lt;STRONG&gt;&lt;EM&gt;Accept it as the solution&lt;/EM&gt;&lt;/STRONG&gt; to help the other members find it more quickly.&lt;/P&gt;</description>
      <pubDate>Fri, 05 Nov 2021 03:18:17 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Converting-3-steps-table-to-only-one-table/m-p/2173826#M50537</guid>
      <dc:creator>v-robertq-msft</dc:creator>
      <dc:date>2021-11-05T03:18:17Z</dc:date>
    </item>
  </channel>
</rss>

