<?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: Add values into a different table in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Add-values-into-a-different-table/m-p/2323533#M58088</link>
    <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="324110" data-lia-user-login="Dimitris_Kats" class="lia-mention lia-mention-user"&gt;Dimitris_Kats&lt;/a&gt; , can explain the car part. May be expected output can help &lt;/P&gt;
&lt;P&gt;&amp;nbsp;You can create a new column like&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;sumx(filter(salary, salary[Employee ID] = expense[Employee ID] &amp;amp;&amp;amp; salary[Period ID] = expense[Period ID]&lt;/P&gt;
&lt;P&gt;&amp;amp;&amp;amp; salary[Country ID] = expense[Country ID]),Salary [Salary])&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;or&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;sumx(filter(salary, salary[Employee ID] = expense[Employee ID] &amp;amp;&amp;amp; salary[Period ID] = expense[Period ID]&lt;/P&gt;
&lt;P&gt;&amp;amp;&amp;amp; salary[Country ID] = expense[Country ID] &amp;amp;&amp;amp; expense[Category] = "Car"),Salary [Salary])&lt;/P&gt;</description>
    <pubDate>Mon, 07 Feb 2022 16:04:20 GMT</pubDate>
    <dc:creator>amitchandak</dc:creator>
    <dc:date>2022-02-07T16:04:20Z</dc:date>
    <item>
      <title>Add values into a different table</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Add-values-into-a-different-table/m-p/2323344#M58072</link>
      <description>&lt;P&gt;Dear members hello,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have a really difficult problem that I have not yet been able to solve.&lt;BR /&gt;&lt;BR /&gt;I have 2 unrelated fact tables. The one table has salary data and the second table expenses data.&amp;nbsp;&lt;BR /&gt;&lt;STRONG&gt;Salary Table:&lt;/STRONG&gt;&lt;BR /&gt;Employee ID Salary Period ID Country ID&lt;BR /&gt;1000&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;1000&amp;nbsp; &amp;nbsp; 20210101&amp;nbsp; 1&lt;BR /&gt;1001&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 900&amp;nbsp; &amp;nbsp; &amp;nbsp;20210101&amp;nbsp; 2&lt;BR /&gt;1002&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 800&amp;nbsp; &amp;nbsp; &amp;nbsp;20210101&amp;nbsp; 3&lt;BR /&gt;1003&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 1100&amp;nbsp; &amp;nbsp; &amp;nbsp;20210101&amp;nbsp; 4&lt;BR /&gt;1004&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 1200&amp;nbsp; &amp;nbsp; &amp;nbsp;20210101&amp;nbsp; 5&lt;BR /&gt;1000&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 1000&amp;nbsp; &amp;nbsp; &amp;nbsp;20210201&amp;nbsp; 1&lt;BR /&gt;1001&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;900&amp;nbsp; &amp;nbsp; &amp;nbsp; 20210201&amp;nbsp; 2&lt;BR /&gt;1002&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;800&amp;nbsp; &amp;nbsp; &amp;nbsp; 20210201&amp;nbsp; 3&lt;BR /&gt;1003&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;1100&amp;nbsp; &amp;nbsp; &amp;nbsp; 20210201&amp;nbsp; 4&lt;BR /&gt;1004&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;1200&amp;nbsp; &amp;nbsp; &amp;nbsp; 20210201&amp;nbsp; 5&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Expenses Table:&lt;BR /&gt;&lt;/STRONG&gt;Employee ID Expenses Category Period ID Country ID&lt;BR /&gt;1000&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 100&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Tickets&amp;nbsp; &amp;nbsp; &amp;nbsp;20210101&amp;nbsp; &amp;nbsp; &amp;nbsp;1&lt;BR /&gt;1001&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 200&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Food&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;20210101&amp;nbsp; &amp;nbsp; &amp;nbsp; 2&lt;BR /&gt;1002&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 100&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Taxi&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;20210101&amp;nbsp; &amp;nbsp; &amp;nbsp; 3&lt;BR /&gt;1003&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 200&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Car&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 20210101&amp;nbsp; &amp;nbsp; &amp;nbsp;4&lt;BR /&gt;1004&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 50&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;Tickets&amp;nbsp; &amp;nbsp; &amp;nbsp;20210101&amp;nbsp; &amp;nbsp; &amp;nbsp; 5&lt;BR /&gt;1000&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 20&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Food&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;20210201&amp;nbsp; &amp;nbsp; &amp;nbsp; 1&lt;BR /&gt;1001&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 35&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Taxi&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;20210201&amp;nbsp; &amp;nbsp; &amp;nbsp; 2&lt;BR /&gt;1002&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 60&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Car&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 20210201&amp;nbsp; &amp;nbsp; &amp;nbsp; 3&lt;BR /&gt;1003&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 80&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;Food&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 20210201&amp;nbsp; &amp;nbsp; &amp;nbsp; 4&lt;BR /&gt;1004&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 100&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;Taxi&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 20210201&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;5&lt;STRONG&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;I would like to find a way to add the salary data of employee with id: 1001 to the expenses table as expenses to the employee with id 1002 at the same period ID and Country ID in the category "Car" if it exist otherwise to be filled in as a car category.&lt;BR /&gt;&lt;BR /&gt;Is that possible?? I can't find a way to achive that &lt;span class="lia-unicode-emoji" title=":disappointed_face:"&gt;😞&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 07 Feb 2022 14:56:13 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Add-values-into-a-different-table/m-p/2323344#M58072</guid>
      <dc:creator>Dimitris_Kats</dc:creator>
      <dc:date>2022-02-07T14:56:13Z</dc:date>
    </item>
    <item>
      <title>Re: Add values into a different table</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Add-values-into-a-different-table/m-p/2323533#M58088</link>
      <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="324110" data-lia-user-login="Dimitris_Kats" class="lia-mention lia-mention-user"&gt;Dimitris_Kats&lt;/a&gt; , can explain the car part. May be expected output can help &lt;/P&gt;
&lt;P&gt;&amp;nbsp;You can create a new column like&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;sumx(filter(salary, salary[Employee ID] = expense[Employee ID] &amp;amp;&amp;amp; salary[Period ID] = expense[Period ID]&lt;/P&gt;
&lt;P&gt;&amp;amp;&amp;amp; salary[Country ID] = expense[Country ID]),Salary [Salary])&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;or&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;sumx(filter(salary, salary[Employee ID] = expense[Employee ID] &amp;amp;&amp;amp; salary[Period ID] = expense[Period ID]&lt;/P&gt;
&lt;P&gt;&amp;amp;&amp;amp; salary[Country ID] = expense[Country ID] &amp;amp;&amp;amp; expense[Category] = "Car"),Salary [Salary])&lt;/P&gt;</description>
      <pubDate>Mon, 07 Feb 2022 16:04:20 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Add-values-into-a-different-table/m-p/2323533#M58088</guid>
      <dc:creator>amitchandak</dc:creator>
      <dc:date>2022-02-07T16:04:20Z</dc:date>
    </item>
    <item>
      <title>Re: Add values into a different table</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Add-values-into-a-different-table/m-p/2330529#M58534</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="324110" data-lia-user-login="Dimitris_Kats" class="lia-mention lia-mention-user"&gt;Dimitris_Kats&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You can use Power Query to do this as you need to add new rows when employee 1002 doesn't have car category with some period and country IDs. Click "Transform data" to open Power Query Editor to transform tables.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Here are my steps to transform both tables:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;Salary Table:&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#0000FF"&gt;1. Filter "Employee ID" column to only have rows that Employee ID = 1001;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#0000FF"&gt;2. Replace "1001" with "1002" in "Employee ID" column;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#0000FF"&gt;3. Add a custom column whose value is "Car", column name is "Category";&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#0000FF"&gt;4. Rename "Salary" column to "Expenses".&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Now you will have below table, which has five columns whose names are totally consistent with those in Expenses Table. This is Employee 1002's Car expenses in every period and country.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;Expenses Table:&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#0000FF"&gt;5. Append above transformed Salary Table to Expenses Table;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#0000FF"&gt;6. Group rows by four columns and perform Sum on "Expenses" column;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#0000FF"&gt;7. Sort Rows.&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Then you will have the following result. ( * In your sample data, Employee 1001 has country ID 2 and 1002 has country ID 3, which cannot be matched. So I changed both to country ID 2 to test it. )&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;In the following image, I have highlighted most features used to transform tables in above steps. Sample pbix is at bottom.&amp;nbsp;&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;Community Support Team _ Jing&lt;BR /&gt;If this post helps, please Accept it as Solution to help other members find it.&lt;/P&gt;</description>
      <pubDate>Thu, 10 Feb 2022 09:43:06 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Add-values-into-a-different-table/m-p/2330529#M58534</guid>
      <dc:creator>v-jingzhang</dc:creator>
      <dc:date>2022-02-10T09:43:06Z</dc:date>
    </item>
    <item>
      <title>Re: Add values into a different table</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Add-values-into-a-different-table/m-p/2406137#M63170</link>
      <description>&lt;P&gt;&lt;SPAN class=""&gt;&lt;SPAN class=""&gt;&lt;SPAN class=""&gt;Thank you very very much.&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN class=""&gt;&lt;SPAN class=""&gt;&lt;SPAN class=""&gt;This is really complex. I need to test it and come back to you.&lt;BR /&gt;So sorry for the late reply. I didn't get a notice for your post.&lt;BR /&gt;&lt;BR /&gt;Thank you very much again!&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 21 Mar 2022 08:38:43 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Add-values-into-a-different-table/m-p/2406137#M63170</guid>
      <dc:creator>Dimitris_Kats</dc:creator>
      <dc:date>2022-03-21T08:38:43Z</dc:date>
    </item>
  </channel>
</rss>

