<?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 How to create a new table base on another table column with condition in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-create-a-new-table-base-on-another-table-column-with/m-p/4138495#M164400</link>
    <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am a new Power BI user and am having difficulty creating a table based on another table row with conditions.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;What I would like to achieve is creating a new table with a distinct row of unique ISSUE_KEY with the latest created date) .&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Table A:&lt;/P&gt;&lt;P&gt;CREATED = Date type&lt;/P&gt;&lt;P&gt;ISSUE_KEY = Character String type&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;New table:&lt;/P&gt;&lt;P&gt;Contains a unique row of the ISSUE_KEY with the latest CREATED date&lt;/P&gt;&lt;P&gt;- Notice there are duplicate rows of ISSUE_KEY with different CREATED dates (could be 2 or more)&lt;BR /&gt;- In the sample table above, there are 2 ISSUE_KEY with different CREATED dates. The new table should have the latest date.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you so much for your help.&lt;/P&gt;&lt;P&gt;--Kent&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;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Fri, 06 Sep 2024 22:30:19 GMT</pubDate>
    <dc:creator>kentchiu</dc:creator>
    <dc:date>2024-09-06T22:30:19Z</dc:date>
    <item>
      <title>How to create a new table base on another table column with condition</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-create-a-new-table-base-on-another-table-column-with/m-p/4138495#M164400</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am a new Power BI user and am having difficulty creating a table based on another table row with conditions.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;What I would like to achieve is creating a new table with a distinct row of unique ISSUE_KEY with the latest created date) .&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Table A:&lt;/P&gt;&lt;P&gt;CREATED = Date type&lt;/P&gt;&lt;P&gt;ISSUE_KEY = Character String type&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;New table:&lt;/P&gt;&lt;P&gt;Contains a unique row of the ISSUE_KEY with the latest CREATED date&lt;/P&gt;&lt;P&gt;- Notice there are duplicate rows of ISSUE_KEY with different CREATED dates (could be 2 or more)&lt;BR /&gt;- In the sample table above, there are 2 ISSUE_KEY with different CREATED dates. The new table should have the latest date.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you so much for your help.&lt;/P&gt;&lt;P&gt;--Kent&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;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 06 Sep 2024 22:30:19 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-create-a-new-table-base-on-another-table-column-with/m-p/4138495#M164400</guid>
      <dc:creator>kentchiu</dc:creator>
      <dc:date>2024-09-06T22:30:19Z</dc:date>
    </item>
    <item>
      <title>Re: How to create a new table base on another table column with condition</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-create-a-new-table-base-on-another-table-column-with/m-p/4138595#M164409</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="671979" data-lia-user-login="kentchiu" class="lia-mention lia-mention-user"&gt;kentchiu&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You can try below DAX Table expression.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;New Table = 
FILTER (
    Table,
    VAR CurCreated = Table[CREATED]
    VAR LatestCreated = CALCULATE (MAX(Table[CREATED]),ALLEXCEPT (Table,Table[ISSUE_KEY]))
    RETURN
    CurCreated = LatestCreated
)&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;But in your this case, the best method is use the PowerQuery to create the new table, which only need two step.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Step1. Sort by&amp;nbsp;&lt;SPAN&gt;ISSUE_KEY and CREATED (The CREATED need to sort in descending)&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;Step2. Perform deduplication on on the table based on ISSUE_KEY&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Because the deduplication operation in PowerQuery will only retain the first occurrence of the row.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Did I answer your question? If yes, pls mark my post as a solution and appreciate your Kudos !&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thank you~&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 07 Sep 2024 03:32:23 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-create-a-new-table-base-on-another-table-column-with/m-p/4138595#M164409</guid>
      <dc:creator>xifeng_L</dc:creator>
      <dc:date>2024-09-07T03:32:23Z</dc:date>
    </item>
    <item>
      <title>Re: How to create a new table base on another table column with condition</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-create-a-new-table-base-on-another-table-column-with/m-p/4138816#M164415</link>
      <description>&lt;P&gt;Hello&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="671979" data-lia-user-login="kentchiu" class="lia-mention lia-mention-user"&gt;kentchiu&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;You can achieve this by using both DAX and PQ.&lt;BR /&gt;Below is the DAX query&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;VAR _1 =
	ADDCOLUMNS(
		SUMMARIZE(
			Source,
			Source[ISSUE_KEY],
			Source[Issue Status Name]
		),
		"@Created",CALCULATE( MAX(Source[CREATED]) )
	)
	RETURN
		_1&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;PQ solution&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;let
    Source = Source,
    #"Grouped Rows" = Table.Group(Source, {"ISSUE_KEY", "Issue Status Name"}, {{"Created", each List.Max([CREATED]), type nullable datetime}})
in
    #"Grouped Rows"&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Below attached file&lt;/P&gt;&lt;P&gt;&lt;A href="https://we.tl/t-tJvge3FSTD" target="_self"&gt;https://we.tl/t-tJvge3FSTD&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Let me know if it helps&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;sanalytics&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&lt;STRONG&gt;If it is your solution then please like and accept it as solution&lt;/STRONG&gt;&lt;/EM&gt;&lt;/P&gt;</description>
      <pubDate>Sat, 07 Sep 2024 12:11:20 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-create-a-new-table-base-on-another-table-column-with/m-p/4138816#M164415</guid>
      <dc:creator>sanalytics</dc:creator>
      <dc:date>2024-09-07T12:11:20Z</dc:date>
    </item>
    <item>
      <title>Re: How to create a new table base on another table column with condition</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-create-a-new-table-base-on-another-table-column-with/m-p/4144413#M164710</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="671979" data-lia-user-login="kentchiu" class="lia-mention lia-mention-user"&gt;kentchiu&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;First of all, thanks to xifeng_L and sanalytics for their positive response!&lt;/P&gt;
&lt;P&gt;I agree with the approach offered by both of them, and if their replies helped you solve your problem, please consider accepting their replies as a solution that will benefit others who are experiencing similar problems.&lt;/P&gt;
&lt;P&gt;If you need any other help, please feel free to contact me.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Best Regards,&lt;BR /&gt;Jarvis Tang&lt;BR /&gt;If this post &lt;EM&gt;&lt;STRONG&gt;helps&lt;/STRONG&gt;&lt;/EM&gt;, then please consider &lt;EM&gt;&lt;STRONG&gt;Accept it as the solution&lt;/STRONG&gt;&lt;/EM&gt; to help the other members find it more quickly.&lt;/P&gt;</description>
      <pubDate>Wed, 11 Sep 2024 08:10:56 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-create-a-new-table-base-on-another-table-column-with/m-p/4144413#M164710</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2024-09-11T08:10:56Z</dc:date>
    </item>
    <item>
      <title>Re: How to create a new table base on another table column with condition</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-create-a-new-table-base-on-another-table-column-with/m-p/4145547#M164741</link>
      <description>&lt;P&gt;Thank you both&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="195725" data-lia-user-login="sanalytics" class="lia-mention lia-mention-user"&gt;sanalytics&lt;/a&gt;&amp;nbsp;and&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="738384" data-lia-user-login="xifeng_L" class="lia-mention lia-mention-user"&gt;xifeng_L&lt;/a&gt;&amp;nbsp; for the solution to my inquiry. They seem to work with both proposed approach solutions.&amp;nbsp; I have tried them and it works as I expected.&lt;/P&gt;</description>
      <pubDate>Wed, 11 Sep 2024 18:04:22 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-create-a-new-table-base-on-another-table-column-with/m-p/4145547#M164741</guid>
      <dc:creator>kentchiu</dc:creator>
      <dc:date>2024-09-11T18:04:22Z</dc:date>
    </item>
  </channel>
</rss>

