<?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: Creating a Calculated Column when Making a Table in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Creating-a-Calculated-Column-when-Making-a-Table/m-p/3592351#M138709</link>
    <description>&lt;DIV&gt;&lt;SPAN&gt;I tried:&amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;"Total Order Amount"&lt;/SPAN&gt;&lt;SPAN&gt;, &lt;/SPAN&gt;&lt;SPAN&gt;CALCULATE&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;Sumx&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;'Orders'&lt;/SPAN&gt;&lt;SPAN&gt;,&lt;/SPAN&gt;&lt;SPAN&gt;'Orders'&lt;/SPAN&gt;&lt;SPAN&gt;[OrderQuantity]&lt;/SPAN&gt;&lt;SPAN&gt;*&lt;/SPAN&gt;&lt;SPAN&gt;'Orders'&lt;/SPAN&gt;&lt;SPAN&gt;[SalesPrice]&lt;/SPAN&gt;&lt;SPAN&gt;),&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;FILTER&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;Orders&lt;/SPAN&gt;&lt;SPAN&gt;, &lt;/SPAN&gt;&lt;SPAN&gt;Orders&lt;/SPAN&gt;&lt;SPAN&gt;[OrderDateKey]&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;Did not work, though&lt;/SPAN&gt;&lt;/DIV&gt;</description>
    <pubDate>Tue, 19 Dec 2023 21:43:08 GMT</pubDate>
    <dc:creator>MichaelG1117</dc:creator>
    <dc:date>2023-12-19T21:43:08Z</dc:date>
    <item>
      <title>Creating a Calculated Column when Making a Table</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Creating-a-Calculated-Column-when-Making-a-Table/m-p/3591932#M138694</link>
      <description>&lt;P&gt;Hi Everyone,&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm making a Date Table and in it I want to include a calculated Column "Total Order Amount" from 'Orders' Table where "Total Order Amount" column equals Orders[OrderQuantity] * Orders[SalesPrice]:&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt; I used this script to create the Date Table (with the extra calculated column):&amp;nbsp;&lt;/P&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;img /&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;But when I do this the "Total Order Amount" Values on the new table are just the whole of all orders combined:&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;img /&gt;&lt;P&gt; &lt;/P&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Any way to fix this so the "Total Order Amount" is [OrderQuantity] * [OrderSales] for each particular date instead of the grand total?&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Any help would be greatly appreciated.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks----&lt;/P&gt;</description>
      <pubDate>Tue, 19 Dec 2023 16:59:06 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Creating-a-Calculated-Column-when-Making-a-Table/m-p/3591932#M138694</guid>
      <dc:creator>MichaelG1117</dc:creator>
      <dc:date>2023-12-19T16:59:06Z</dc:date>
    </item>
    <item>
      <title>Re: Creating a Calculated Column when Making a Table</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Creating-a-Calculated-Column-when-Making-a-Table/m-p/3592026#M138698</link>
      <description>&lt;P&gt;HI,&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="661819" data-lia-user-login="MichaelG1117" class="lia-mention lia-mention-user"&gt;MichaelG1117&lt;/a&gt;&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;I think it is correct because there are no filter part present in table from where total order amount column filter means your column(total order amount) has no data lineage for that table so you have to provide some filter part like &lt;STRONG&gt;product code or product name or orderquantity(as above in your first image) or&lt;/STRONG&gt;&amp;nbsp;something from which your column(total order amount) filter according to that&lt;/P&gt;</description>
      <pubDate>Tue, 19 Dec 2023 17:37:55 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Creating-a-Calculated-Column-when-Making-a-Table/m-p/3592026#M138698</guid>
      <dc:creator>Dangar332</dc:creator>
      <dc:date>2023-12-19T17:37:55Z</dc:date>
    </item>
    <item>
      <title>Re: Creating a Calculated Column when Making a Table</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Creating-a-Calculated-Column-when-Making-a-Table/m-p/3592033#M138699</link>
      <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="661819" data-lia-user-login="MichaelG1117" class="lia-mention lia-mention-user"&gt;MichaelG1117&lt;/a&gt;&amp;nbsp;Maybe try using RELATEDTABLE in your SUMX although it may not work as the relationship may not technically exist yet as the table is being calculated (created). Could also explore dropping the CALCULATE.&lt;/P&gt;</description>
      <pubDate>Tue, 19 Dec 2023 17:38:12 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Creating-a-Calculated-Column-when-Making-a-Table/m-p/3592033#M138699</guid>
      <dc:creator>Greg_Deckler</dc:creator>
      <dc:date>2023-12-19T17:38:12Z</dc:date>
    </item>
    <item>
      <title>Re: Creating a Calculated Column when Making a Table</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Creating-a-Calculated-Column-when-Making-a-Table/m-p/3592351#M138709</link>
      <description>&lt;DIV&gt;&lt;SPAN&gt;I tried:&amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;"Total Order Amount"&lt;/SPAN&gt;&lt;SPAN&gt;, &lt;/SPAN&gt;&lt;SPAN&gt;CALCULATE&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;Sumx&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;'Orders'&lt;/SPAN&gt;&lt;SPAN&gt;,&lt;/SPAN&gt;&lt;SPAN&gt;'Orders'&lt;/SPAN&gt;&lt;SPAN&gt;[OrderQuantity]&lt;/SPAN&gt;&lt;SPAN&gt;*&lt;/SPAN&gt;&lt;SPAN&gt;'Orders'&lt;/SPAN&gt;&lt;SPAN&gt;[SalesPrice]&lt;/SPAN&gt;&lt;SPAN&gt;),&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;FILTER&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;Orders&lt;/SPAN&gt;&lt;SPAN&gt;, &lt;/SPAN&gt;&lt;SPAN&gt;Orders&lt;/SPAN&gt;&lt;SPAN&gt;[OrderDateKey]&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;Did not work, though&lt;/SPAN&gt;&lt;/DIV&gt;</description>
      <pubDate>Tue, 19 Dec 2023 21:43:08 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Creating-a-Calculated-Column-when-Making-a-Table/m-p/3592351#M138709</guid>
      <dc:creator>MichaelG1117</dc:creator>
      <dc:date>2023-12-19T21:43:08Z</dc:date>
    </item>
    <item>
      <title>Re: Creating a Calculated Column when Making a Table</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Creating-a-Calculated-Column-when-Making-a-Table/m-p/3592353#M138710</link>
      <description>&lt;P&gt;I tried taking out the SumX, did not work.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Tried Relatedtable but was unsure what the script would be --- didn't work&lt;/P&gt;</description>
      <pubDate>Tue, 19 Dec 2023 21:44:23 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Creating-a-Calculated-Column-when-Making-a-Table/m-p/3592353#M138710</guid>
      <dc:creator>MichaelG1117</dc:creator>
      <dc:date>2023-12-19T21:44:23Z</dc:date>
    </item>
    <item>
      <title>Re: Creating a Calculated Column when Making a Table</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Creating-a-Calculated-Column-when-Making-a-Table/m-p/3592419#M138715</link>
      <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="661819" data-lia-user-login="MichaelG1117" class="lia-mention lia-mention-user"&gt;MichaelG1117&lt;/a&gt;&amp;nbsp;Keep the SUMX. Drop the CALCULATE. Use RELATED or RELATEDTABLE as the first argument for your SUMX&lt;/P&gt;</description>
      <pubDate>Tue, 19 Dec 2023 23:03:17 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Creating-a-Calculated-Column-when-Making-a-Table/m-p/3592419#M138715</guid>
      <dc:creator>Greg_Deckler</dc:creator>
      <dc:date>2023-12-19T23:03:17Z</dc:date>
    </item>
    <item>
      <title>Re: Creating a Calculated Column when Making a Table</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Creating-a-Calculated-Column-when-Making-a-Table/m-p/3593431#M138798</link>
      <description>&lt;P&gt;Hi &lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="661819" data-lia-user-login="MichaelG1117" class="lia-mention lia-mention-user"&gt;MichaelG1117&lt;/a&gt;&amp;nbsp;,&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P class="" style="text-align: justify; background: white;"&gt;&lt;SPAN&gt;Based on your description, Please try code as below to create a Calculated Column.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="text-align: justify; background: white;"&gt;&lt;SPAN&gt;My Sample:&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;Table = 
var _table=
ADDCOLUMNS(
    CALENDAR(DATE(2013,1,1),DATE(2013,1,31)),
    "Weeknum", WEEKNUM([Date]),
    "Week Number &amp;amp; Year", "W" &amp;amp; WEEKNUM([Date]) &amp;amp; " " &amp;amp;YEAR([Date]),
    "WeekYearNumber", YEAR([Date]) &amp;amp; 100 + WEEKNUM([Date])
    )
return
ADDCOLUMNS(
    _table,    
    "Total Order Amount",
    SUMX(
    FILTER(ALL(Orders),
    'Orders'[OrdeDaterKey]=EARLIER([Date])),[OrderQuantity]*[SalesPrice])
    )&lt;/LI-CODE&gt;
&lt;P&gt;Result is as below.&lt;/P&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Best Regards,&lt;BR /&gt;Yulia Yan&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;
&lt;P style="text-align: justify; background: white;"&gt;&lt;SPAN&gt;If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 20 Dec 2023 10:03:14 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Creating-a-Calculated-Column-when-Making-a-Table/m-p/3593431#M138798</guid>
      <dc:creator>v-weiyan1-msft</dc:creator>
      <dc:date>2023-12-20T10:03:14Z</dc:date>
    </item>
    <item>
      <title>Re: Creating a Calculated Column when Making a Table</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Creating-a-Calculated-Column-when-Making-a-Table/m-p/3594704#M138869</link>
      <description>&lt;P&gt;Thanks!&lt;/P&gt;</description>
      <pubDate>Wed, 20 Dec 2023 18:40:41 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Creating-a-Calculated-Column-when-Making-a-Table/m-p/3594704#M138869</guid>
      <dc:creator>MichaelG1117</dc:creator>
      <dc:date>2023-12-20T18:40:41Z</dc:date>
    </item>
  </channel>
</rss>

