<?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: Dax formula to select a row based on multiple criteria and eliminate duplicates in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Dax-formula-to-select-a-row-based-on-multiple-criteria-and/m-p/4273287#M169519</link>
    <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="839735" data-lia-user-login="mbunchj8" class="lia-mention lia-mention-user"&gt;mbunchj8&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I've made a a test for your reference:&lt;/P&gt;
&lt;P&gt;1\I assume there is a table&lt;/P&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;P&gt;2\Add a new caculate table&lt;/P&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;FilteredTable = 
    FILTER(
        'YourTableName',
        'YourTableName'[Version] = 
            CALCULATE(
                MAX('YourTableName'[Version]),
                ALLEXCEPT('YourTableName', 'YourTableName'[Contract ID])
            )
    )&lt;/LI-CODE&gt;
&lt;P&gt;&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;/P&gt;
&lt;P&gt;Bof&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Thu, 07 Nov 2024 02:36:26 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2024-11-07T02:36:26Z</dc:date>
    <item>
      <title>Dax formula to select a row based on multiple criteria and eliminate duplicates</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Dax-formula-to-select-a-row-based-on-multiple-criteria-and/m-p/4273134#M169510</link>
      <description>&lt;P&gt;Hello - I am learning Dax and I am stuck with filtering a table and removing duplicates.&amp;nbsp; I wish to filter the table to show the latest version of a contract, by contract id.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;My table consist of the following:&lt;/P&gt;&lt;P&gt;Contract ID |&amp;nbsp; Supplier | version | Descr | Begin Date | Expire Date | Max Amount | Line Released Amount | Contract Line number.&lt;/P&gt;&lt;P&gt;&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;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I want a Dax formula that will return one line per Contract ID based on the latest version # of the contract.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am looking for&amp;nbsp; the formula to return the data I manually highlighted in yellow.&amp;nbsp; Is this possible?&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>Thu, 07 Nov 2024 00:04:19 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Dax-formula-to-select-a-row-based-on-multiple-criteria-and/m-p/4273134#M169510</guid>
      <dc:creator>mbunchj8</dc:creator>
      <dc:date>2024-11-07T00:04:19Z</dc:date>
    </item>
    <item>
      <title>Re: Dax formula to select a row based on multiple criteria and eliminate duplicates</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Dax-formula-to-select-a-row-based-on-multiple-criteria-and/m-p/4273137#M169511</link>
      <description>&lt;P&gt;hi &lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="839735" data-lia-user-login="mbunchj8" class="lia-mention lia-mention-user"&gt;mbunchj8&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;we can do with DAX, but it is more advisible to do with Power Query.&lt;/P&gt;
&lt;P&gt;Try with Power Query:&lt;/P&gt;
&lt;P&gt;1. sort by version column,&lt;/P&gt;
&lt;P&gt;2. then select Contract ID column,&amp;nbsp;&lt;SPAN&gt;remove duplicate rows&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 07 Nov 2024 00:16:24 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Dax-formula-to-select-a-row-based-on-multiple-criteria-and/m-p/4273137#M169511</guid>
      <dc:creator>FreemanZ</dc:creator>
      <dc:date>2024-11-07T00:16:24Z</dc:date>
    </item>
    <item>
      <title>Re: Dax formula to select a row based on multiple criteria and eliminate duplicates</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Dax-formula-to-select-a-row-based-on-multiple-criteria-and/m-p/4273287#M169519</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="839735" data-lia-user-login="mbunchj8" class="lia-mention lia-mention-user"&gt;mbunchj8&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I've made a a test for your reference:&lt;/P&gt;
&lt;P&gt;1\I assume there is a table&lt;/P&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;P&gt;2\Add a new caculate table&lt;/P&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;FilteredTable = 
    FILTER(
        'YourTableName',
        'YourTableName'[Version] = 
            CALCULATE(
                MAX('YourTableName'[Version]),
                ALLEXCEPT('YourTableName', 'YourTableName'[Contract ID])
            )
    )&lt;/LI-CODE&gt;
&lt;P&gt;&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;/P&gt;
&lt;P&gt;Bof&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 07 Nov 2024 02:36:26 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Dax-formula-to-select-a-row-based-on-multiple-criteria-and/m-p/4273287#M169519</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2024-11-07T02:36:26Z</dc:date>
    </item>
    <item>
      <title>Re: Dax formula to select a row based on multiple criteria and eliminate duplicates</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Dax-formula-to-select-a-row-based-on-multiple-criteria-and/m-p/4273406#M169523</link>
      <description>&lt;P&gt;Hey&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="839735" data-lia-user-login="mbunchj8" class="lia-mention lia-mention-user"&gt;mbunchj8&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;&lt;P&gt;Hope you're doing good!&lt;/P&gt;&lt;P class="lia-align-justify"&gt;Here's what I have for you.&lt;BR /&gt;DAX:-&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;LatestContracts =
VAR LatestVersionPerContract =
    SUMMARIZE(
        'Contracts', 
        'Contracts'[Contract ID], 
        "LatestVersion", MAX('Contracts'[Version])
    )
RETURN
    FILTER(
        'Contracts',
        'Contracts'[Version] = LOOKUPVALUE(
            LatestVersionPerContract[LatestVersion],
            LatestVersionPerContract[Contract ID], 'Contracts'[Contract ID]
        )
    )&lt;/LI-CODE&gt;&lt;P class="lia-align-justify"&gt;This formula will return a table with one row per CONTRACT ID&amp;nbsp;showing only the latest version for each contract.&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P class="lia-align-justify"&gt;Please let me know if it helps you solve your problem.&lt;/P&gt;&lt;P class="lia-align-justify"&gt;&amp;nbsp;&lt;/P&gt;&lt;P class="lia-align-justify"&gt;Regards,&lt;BR /&gt;Poojara.&lt;/P&gt;</description>
      <pubDate>Thu, 07 Nov 2024 05:00:35 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Dax-formula-to-select-a-row-based-on-multiple-criteria-and/m-p/4273406#M169523</guid>
      <dc:creator>Poojara_D12</dc:creator>
      <dc:date>2024-11-07T05:00:35Z</dc:date>
    </item>
    <item>
      <title>Re: Dax formula to select a row based on multiple criteria and eliminate duplicates</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Dax-formula-to-select-a-row-based-on-multiple-criteria-and/m-p/4286574#M170131</link>
      <description>&lt;P&gt;FreemanZ -&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I thought I would try a solution that seemed the easiest first.&amp;nbsp; When I followed your instructions and sorted the table by Contract Version (Highest to lowest).&amp;nbsp; It looked good.&amp;nbsp; I had a contract with version 08 on top of the list.&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I then went to the Contract ID Column and selected "Remove Duplicates".&amp;nbsp; Thios removed the duplicate contract IDs but it left&amp;nbsp; only the version 01 contract ID lines.&amp;nbsp; I did not get the version 08 or any other version besides version 01.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I wish this worked but I am not being left with the latest (highest contract version) as my result.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank You -&lt;/P&gt;</description>
      <pubDate>Fri, 15 Nov 2024 19:46:03 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Dax-formula-to-select-a-row-based-on-multiple-criteria-and/m-p/4286574#M170131</guid>
      <dc:creator>mbunchj8</dc:creator>
      <dc:date>2024-11-15T19:46:03Z</dc:date>
    </item>
    <item>
      <title>Re: Dax formula to select a row based on multiple criteria and eliminate duplicates</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Dax-formula-to-select-a-row-based-on-multiple-criteria-and/m-p/4286630#M170134</link>
      <description>&lt;DIV class=""&gt;&lt;SPAN class=""&gt;&lt;SPAN class=""&gt;&lt;SPAN class=""&gt;Poojara_D12&amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV class=""&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV class=""&gt;&lt;SPAN class=""&gt;&lt;SPAN class=""&gt;&lt;SPAN class=""&gt;I am trying to incorporate the formula you have into the Power Querry.&amp;nbsp; I thinmk I am entering it in the wrong maner.&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV class=""&gt;&lt;SPAN class=""&gt;&lt;SPAN class=""&gt;&lt;SPAN class=""&gt;Where do I insert the formula?&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV class=""&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV class=""&gt;&lt;SPAN class=""&gt;&lt;SPAN class=""&gt;&lt;SPAN class=""&gt;&lt;img /&gt;&lt;img /&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV class=""&gt;&lt;A href="https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Dax-formula-to-select-a-row-based-on-multiple-criteria-and/m-p/4273406#" target="_blank" rel="noopener"&gt;Preview&lt;/A&gt;&lt;DIV class=""&gt;&lt;DIV class=""&gt;&lt;DIV class=""&gt;&lt;DIV class=""&gt;&lt;DIV class=""&gt;&lt;DIV class=""&gt;&lt;DIV class=""&gt;&lt;DIV class=""&gt;&lt;DIV class=""&gt;&amp;nbsp;&lt;/DIV&gt;&lt;/DIV&gt;&lt;DIV class=""&gt;&lt;DIV class=""&gt;&lt;DIV class=""&gt;&lt;DIV class=""&gt;&lt;DIV class=""&gt;&lt;DIV class=""&gt;&lt;DIV class=""&gt;&lt;DIV class=""&gt;&lt;DIV class=""&gt;&lt;DIV&gt;&lt;DIV class=""&gt;&amp;nbsp;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;</description>
      <pubDate>Fri, 15 Nov 2024 20:57:43 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Dax-formula-to-select-a-row-based-on-multiple-criteria-and/m-p/4286630#M170134</guid>
      <dc:creator>mbunchj8</dc:creator>
      <dc:date>2024-11-15T20:57:43Z</dc:date>
    </item>
  </channel>
</rss>

