<?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: Compare two columns on two different tables and create a new record if the criteria is met in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Compare-two-columns-on-two-different-tables-and-create-a-new/m-p/1464673#M27700</link>
    <description>&lt;P&gt;Anonymous&lt;/LI-USER&gt; , If they both are joined, Summarize should allow you to select data from both tables, even if one table is used in table name. &lt;/P&gt;
&lt;P&gt;Of the top of that, you can use the filter&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Filter(Summarize(Table1, Table[Col1], Table2[col2]), [Col1]=[Col2])&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;if they have excat same name then Summarize will not allow rename, You can use selectcolumns for one table.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Also refer&lt;/P&gt;
&lt;P&gt;&lt;A href="https://www.sqlbi.com/articles/from-sql-to-dax-joining-tables/" target="_blank"&gt;https://www.sqlbi.com/articles/from-sql-to-dax-joining-tables/&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;and &lt;A href="https://radacad.com/append-vs-merge-in-power-bi-and-power-query" target="_blank"&gt;https://radacad.com/append-vs-merge-in-power-bi-and-power-query&lt;/A&gt;&lt;/P&gt;</description>
    <pubDate>Fri, 30 Oct 2020 01:56:04 GMT</pubDate>
    <dc:creator>amitchandak</dc:creator>
    <dc:date>2020-10-30T01:56:04Z</dc:date>
    <item>
      <title>Compare two columns on two different tables and create a new record if the criteria is met</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Compare-two-columns-on-two-different-tables-and-create-a-new/m-p/1463921#M27671</link>
      <description>&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Hello,&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;I am new to DAX, getting better everyday but I feel like this issue is beyond my reach on my own - hopefully you'll be able to help me.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Issue&lt;/STRONG&gt; : I'd like to compare two values from two different tables (on a 1-1 relationship) and if a criteria is met, create a record on a third table.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I don't have permissions to upload images, but I'll explain it as best as I can.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;My data model is :&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;&lt;FONT color="#0000FF"&gt;&lt;FONT color="#000000"&gt;Table&lt;/FONT&gt; &lt;/FONT&gt;&lt;STRONG&gt;&lt;FONT color="#0000FF"&gt;KPI_Today&lt;/FONT&gt;&lt;/STRONG&gt; (KPIs of the current day) ;&lt;/LI&gt;&lt;LI&gt;&lt;FONT color="#000000"&gt;Table &lt;/FONT&gt;&lt;STRONG&gt;&lt;FONT color="#800080"&gt;KPI_L7D&amp;nbsp;&lt;/FONT&gt;&lt;/STRONG&gt;(Average of each KPIs on the last seven days) ;&amp;nbsp;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;The relationship is 1-1 and done on a Primary Key ("Hour" column).&amp;nbsp;&lt;BR /&gt;Both tables have the exact same column names, and I have one line for one hour of the day (so 24 rows fo each of them).&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Goal&lt;/STRONG&gt; : I want to create a third table which will be called &lt;FONT color="#FF9900"&gt;&lt;STRONG&gt;T_Alerts&lt;/STRONG&gt;&lt;/FONT&gt; that will compare one KPI (for now, then I'd like to compare more KPIs) from one table to the other same KPI on the other one (on the same hour, which is the PK).&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;&lt;STRONG&gt;Example&lt;/STRONG&gt; : I want to check if my "Orders" on table &lt;STRONG&gt;&lt;FONT color="#3366FF"&gt;KPI_Today&lt;/FONT&gt;&lt;/STRONG&gt; is not 20% higher/lower than my "Orders" on &lt;STRONG&gt;&lt;FONT color="#800080"&gt;KPI_L7D&lt;/FONT&gt;&lt;/STRONG&gt; on each hour, and if yes, create a record on the table &lt;STRONG&gt;&lt;FONT color="#FF9900"&gt;T_Alerts&lt;/FONT&gt;&lt;/STRONG&gt; with the following columns : "Alerte", "Orders", "Hour", "Delta" (the %change).&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;Does it make sense ?&amp;nbsp;&lt;BR /&gt;I feel like it's not an easy one but in the same time, I'm sure it has already been done.&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;Thanks a lot for any tips, leads, solutions!&lt;BR /&gt;Alex&lt;/P&gt;</description>
      <pubDate>Thu, 29 Oct 2020 16:21:16 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Compare-two-columns-on-two-different-tables-and-create-a-new/m-p/1463921#M27671</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2020-10-29T16:21:16Z</dc:date>
    </item>
    <item>
      <title>Re: Compare two columns on two different tables and create a new record if the criteria is met</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Compare-two-columns-on-two-different-tables-and-create-a-new/m-p/1464673#M27700</link>
      <description>&lt;P&gt;Anonymous&lt;/LI-USER&gt; , If they both are joined, Summarize should allow you to select data from both tables, even if one table is used in table name. &lt;/P&gt;
&lt;P&gt;Of the top of that, you can use the filter&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Filter(Summarize(Table1, Table[Col1], Table2[col2]), [Col1]=[Col2])&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;if they have excat same name then Summarize will not allow rename, You can use selectcolumns for one table.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Also refer&lt;/P&gt;
&lt;P&gt;&lt;A href="https://www.sqlbi.com/articles/from-sql-to-dax-joining-tables/" target="_blank"&gt;https://www.sqlbi.com/articles/from-sql-to-dax-joining-tables/&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;and &lt;A href="https://radacad.com/append-vs-merge-in-power-bi-and-power-query" target="_blank"&gt;https://radacad.com/append-vs-merge-in-power-bi-and-power-query&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 30 Oct 2020 01:56:04 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Compare-two-columns-on-two-different-tables-and-create-a-new/m-p/1464673#M27700</guid>
      <dc:creator>amitchandak</dc:creator>
      <dc:date>2020-10-30T01:56:04Z</dc:date>
    </item>
  </channel>
</rss>

