<?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: Merging two tables in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Merging-two-tables/m-p/4330286#M171891</link>
    <description>&lt;P&gt;Thanks for the reply from tharunkumarRTK&amp;nbsp;and gmsamborn&amp;nbsp;, please allow me to provide another insight:&amp;nbsp; &lt;BR /&gt;Hi&amp;nbsp; &lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="727498" data-lia-user-login="Mangnuel" class="lia-mention lia-mention-user"&gt;Mangnuel&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Here are the steps you can follow：&lt;/P&gt;
&lt;P&gt;1. Create calculated table.&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;Table =
ADDCOLUMNS(
    'Table 1',
    "Yield Utility",
    SUMX(
        FILTER(ALL('Table 2'),
    'Table 2'[Date]=EARLIER('Table 1'[Date])&amp;amp;&amp;amp;
    'Table 1'[Asset-Code]=EARLIER('Table 1'[Asset-Code])),[Yield Utility]))&lt;/LI-CODE&gt;
&lt;P&gt;2. Result:&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;/P&gt;
&lt;P&gt;Liu Yang&lt;/P&gt;
&lt;P&gt;If this post &lt;STRONG&gt;helps&lt;/STRONG&gt;, then please consider &lt;EM&gt;Accept it as the solution&lt;/EM&gt; to help the other members find it more quickly&lt;/P&gt;</description>
    <pubDate>Mon, 16 Dec 2024 07:13:15 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2024-12-16T07:13:15Z</dc:date>
    <item>
      <title>Merging two tables</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Merging-two-tables/m-p/4329401#M171856</link>
      <description>&lt;P&gt;Ey Power-Bi world,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I need help please &lt;span class="lia-unicode-emoji" title=":smiling_face_with_smiling_eyes:"&gt;😊&lt;/span&gt;&lt;BR /&gt;&lt;BR /&gt;Topic or Task: Merge / Combining two tables with given rules&lt;BR /&gt;&lt;BR /&gt;I need to combine two different tables.&lt;BR /&gt;First table looks like this&lt;BR /&gt;&lt;img /&gt;&lt;BR /&gt;Date, Asset-Code and a few Values&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;second table looks like this&lt;BR /&gt;&lt;img /&gt;&lt;BR /&gt;pretty much the same, just the Date, Asset-code and only one Value,&lt;BR /&gt;Both tables include the yield of the asset, but from different sources.&lt;BR /&gt;The utility is always a few months behand the SCADA-Readings.&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;Goal ist to merge the to tables, but just as far as we have utility values. Rest from the first table is not included or will follow as soon as we have the data from the officials (Utility).&lt;BR /&gt;&lt;BR /&gt;&lt;img /&gt;&lt;BR /&gt;&lt;BR /&gt;Thanks in adavance.&lt;BR /&gt;&lt;BR /&gt;The final table is needed for my measures. So al calculations have the same amount of data and no months are missing.&lt;/P&gt;</description>
      <pubDate>Sat, 14 Dec 2024 21:41:56 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Merging-two-tables/m-p/4329401#M171856</guid>
      <dc:creator>Mangnuel</dc:creator>
      <dc:date>2024-12-14T21:41:56Z</dc:date>
    </item>
    <item>
      <title>Re: Merging two tables</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Merging-two-tables/m-p/4329406#M171858</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="727498" data-lia-user-login="Mangnuel" class="lia-mention lia-mention-user"&gt;Mangnuel&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;In this case, you should be able to use “Merge Queries as New”.&lt;/P&gt;
&lt;P&gt;In Power Query:&lt;/P&gt;
&lt;OL&gt;
&lt;LI&gt;Select your Table1 and in the Combine section of the Home menu, select Merge Queries As New.&lt;/LI&gt;
&lt;LI&gt;In the Merge window, select Table 2 as the second table.&amp;nbsp; Select the common columns in each table ( Date and Asset-Code ) using the CTRL key, and hit OK.&lt;/LI&gt;
&lt;LI&gt;In the Merge1 table, expand the Table 2 column, and select ONLY Yield Utility and hit OK.&lt;/LI&gt;
&lt;LI&gt;In the new Yield Utility column, filter out the null values.&lt;/LI&gt;
&lt;/OL&gt;
&lt;P&gt;Let me know if you have any questions.&lt;/P&gt;</description>
      <pubDate>Sat, 14 Dec 2024 23:13:23 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Merging-two-tables/m-p/4329406#M171858</guid>
      <dc:creator>gmsamborn</dc:creator>
      <dc:date>2024-12-14T23:13:23Z</dc:date>
    </item>
    <item>
      <title>Re: Merging two tables</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Merging-two-tables/m-p/4329411#M171859</link>
      <description>&lt;P&gt;Hi &lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="426215" data-lia-user-login="gmsamborn" class="lia-mention lia-mention-user"&gt;gmsamborn&lt;/a&gt;&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;it works perfectly, thanks a lot.&lt;BR /&gt;Everyhting looks good!&lt;BR /&gt;&lt;BR /&gt;But one further questions.&lt;BR /&gt;Is it also possible within Power Bi by using DAX-Formulars?&lt;BR /&gt;&lt;BR /&gt;Thanks again&lt;/P&gt;</description>
      <pubDate>Sat, 14 Dec 2024 23:21:16 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Merging-two-tables/m-p/4329411#M171859</guid>
      <dc:creator>Mangnuel</dc:creator>
      <dc:date>2024-12-14T23:21:16Z</dc:date>
    </item>
    <item>
      <title>Re: Merging two tables</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Merging-two-tables/m-p/4329413#M171860</link>
      <description>&lt;P&gt;Problem is,&lt;BR /&gt;&lt;BR /&gt;First Tabel, Daily resolution.&lt;BR /&gt;Seconde Tabel, monthly resolution.&lt;BR /&gt;So I only have one value on the first day of the month beeing the monthly total.&lt;/P&gt;</description>
      <pubDate>Sat, 14 Dec 2024 23:28:28 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Merging-two-tables/m-p/4329413#M171860</guid>
      <dc:creator>Mangnuel</dc:creator>
      <dc:date>2024-12-14T23:28:28Z</dc:date>
    </item>
    <item>
      <title>Re: Merging two tables</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Merging-two-tables/m-p/4329414#M171861</link>
      <description>&lt;P&gt;OK.&lt;/P&gt;
&lt;P&gt;First, I can't think of an easy way to do it in DAX.&amp;nbsp; Not saying there isn't a way.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Second, if you have a date table you should use either a month-name column or preferably a Yr-Mon column instead of the date column.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Does this help?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Also, can you show the expected &lt;STRONG&gt;result from your example data&lt;/STRONG&gt; to verify numbers?&lt;/P&gt;
&lt;P&gt;(also best would be a pbix with sample data)&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 15 Dec 2024 01:44:42 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Merging-two-tables/m-p/4329414#M171861</guid>
      <dc:creator>gmsamborn</dc:creator>
      <dc:date>2024-12-15T01:44:42Z</dc:date>
    </item>
    <item>
      <title>Re: Merging two tables</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Merging-two-tables/m-p/4329476#M171864</link>
      <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="727498" data-lia-user-login="Mangnuel" class="lia-mention lia-mention-user"&gt;Mangnuel&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;EM&gt;Though I wont recommend creating DAX cacculated tables and columns, I am providing some possibilities for education purposes.&lt;/EM&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Yes you can do the same with DAX.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;1. create a caculated column in both Table 1 and Table 2. The column definition should be, a concatenation of YearMonth column and Asset-Code column. (Ex: Jan-24 | A).&lt;/P&gt;
&lt;P&gt;(Lets assume you named your new column as a Join_Key)&lt;/P&gt;
&lt;P&gt;2. You can use DAX join functions perform the merge operation.&lt;/P&gt;
&lt;P&gt;&lt;A href="https://www.sqlbi.com/articles/using-join-functions-in-dax/" target="_blank"&gt;https://www.sqlbi.com/articles/using-join-functions-in-dax/&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Please be informed, you can also merge tables with out creating a new calcualted column, I am suggesting you to do so as it would be simpler to understand.&amp;nbsp;&lt;SPAN&gt;The join functions in DAX can also be used without relationships, but in that case, the join condition is applied to columns with the same data lineage regardless of the column name or the same name and no data lineage.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;A href="https://www.sqlbi.com/articles/replacing-relationships-with-join-functions-in-dax" target="_blank"&gt;https://www.sqlbi.com/articles/replacing-relationships-with-join-functions-in-dax&lt;/A&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Need a Power BI Consultation? Hire me on &lt;A href="https://bit.ly/4d3oy4s" target="_blank" rel="noopener"&gt;Upwork&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Connect on &lt;A href="https://www.linkedin.com/in/tharun-kumar-ravikrindhi/" target="_blank" rel="noopener"&gt;LinkedIn&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;DIV class=""&gt;&lt;BR /&gt;&lt;BR /&gt;
&lt;DIV class=""&gt;&lt;BR /&gt;&lt;BR /&gt;
&lt;DIV style="border-radius: 1px; padding: 10px; border: solid #cccccc 1px; background: #fafafa no-repeat right 10px center;"&gt;&lt;BR /&gt;
&lt;TABLE&gt;
&lt;TBODY&gt;
&lt;TR&gt;
&lt;TD&gt;&lt;BR /&gt;&lt;BR /&gt;
&lt;TABLE&gt;
&lt;TBODY&gt;
&lt;TR&gt;
&lt;TD&gt;&lt;STRONG style="margin-right: 3px;"&gt;&lt;STRONG style="margin-right: 3px;"&gt;Did I answer your question? Mark my post as a solution!&lt;/STRONG&gt;&lt;/STRONG&gt;&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD&gt;&lt;STRONG style="margin-right: 3px;"&gt;&lt;STRONG style="margin-right: 3px;"&gt;If I helped you, click on the Thumbs Up to give Kudos.&lt;BR /&gt;&lt;/STRONG&gt;&lt;/STRONG&gt;&lt;BR /&gt;
&lt;P style="padding: 0; margin: 5px 50px 0 0;"&gt;Proud to be a Super User!&lt;/P&gt;
&lt;/TD&gt;
&lt;TD&gt;&lt;BR /&gt;
&lt;DIV&gt;&lt;img /&gt;&lt;/DIV&gt;
&lt;/TD&gt;
&lt;/TR&gt;
&lt;/TBODY&gt;
&lt;/TABLE&gt;
&lt;/TD&gt;
&lt;/TR&gt;
&lt;/TBODY&gt;
&lt;/TABLE&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 15 Dec 2024 06:17:00 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Merging-two-tables/m-p/4329476#M171864</guid>
      <dc:creator>tharunkumarRTK</dc:creator>
      <dc:date>2024-12-15T06:17:00Z</dc:date>
    </item>
    <item>
      <title>Re: Merging two tables</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Merging-two-tables/m-p/4330286#M171891</link>
      <description>&lt;P&gt;Thanks for the reply from tharunkumarRTK&amp;nbsp;and gmsamborn&amp;nbsp;, please allow me to provide another insight:&amp;nbsp; &lt;BR /&gt;Hi&amp;nbsp; &lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="727498" data-lia-user-login="Mangnuel" class="lia-mention lia-mention-user"&gt;Mangnuel&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Here are the steps you can follow：&lt;/P&gt;
&lt;P&gt;1. Create calculated table.&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;Table =
ADDCOLUMNS(
    'Table 1',
    "Yield Utility",
    SUMX(
        FILTER(ALL('Table 2'),
    'Table 2'[Date]=EARLIER('Table 1'[Date])&amp;amp;&amp;amp;
    'Table 1'[Asset-Code]=EARLIER('Table 1'[Asset-Code])),[Yield Utility]))&lt;/LI-CODE&gt;
&lt;P&gt;2. Result:&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;/P&gt;
&lt;P&gt;Liu Yang&lt;/P&gt;
&lt;P&gt;If this post &lt;STRONG&gt;helps&lt;/STRONG&gt;, then please consider &lt;EM&gt;Accept it as the solution&lt;/EM&gt; to help the other members find it more quickly&lt;/P&gt;</description>
      <pubDate>Mon, 16 Dec 2024 07:13:15 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Merging-two-tables/m-p/4330286#M171891</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2024-12-16T07:13:15Z</dc:date>
    </item>
  </channel>
</rss>

