<?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: Power BI desktop - Handling Ties using DAX measure/ RANK in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Power-BI-desktop-Handling-Ties-using-DAX-measure-RANK/m-p/4869510#M185656</link>
    <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="627817" data-lia-user-login="Amudha_Kumaran" class="lia-mention lia-mention-user"&gt;Amudha_Kumaran&lt;/a&gt;&amp;nbsp;,&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;Thanks for the feedback. If the measure is consistently returning &lt;STRONG&gt;1&lt;/STRONG&gt; for every row, it usually means that the &lt;STRONG&gt;Row Context&lt;/STRONG&gt; is not being properly filtered &lt;I&gt;or&lt;/I&gt; the MaxDaysForActivity calculation is incorrectly seeing the same Days value as the current row.&lt;/P&gt;&lt;P&gt;The most robust way to ensure the calculation ignores the row-level filters (like the specific values of Days and Counterparty for that row) is to use ALL('YourTable') inside the CALCULATE to clear all internal table filters, and then explicitly re-apply the filter for the current Activity_ID.&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;BR /&gt;maybe you can try:&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;Is Latest Flag =
VAR CurrentActivityID = MAX('YourTable'[Activity_ID])
VAR CurrentDays = MAX('YourTable'[Days])
VAR MaxDaysForActivity =
    CALCULATE(
        MAX('YourTable'[Days]),
        ALL('YourTable'),                                  -- Clear all filters from the table
        KEEPFILTERS('YourTable'[Activity_ID] = CurrentActivityID) -- Only keep the filter for the current Activity_ID
    )
RETURN
    IF(
        CurrentDays = MaxDaysForActivity,
        1, -- Latest record
        0  -- Not the latest record
    )&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Fri, 07 Nov 2025 21:30:41 GMT</pubDate>
    <dc:creator>Zanqueta</dc:creator>
    <dc:date>2025-11-07T21:30:41Z</dc:date>
    <item>
      <title>Power BI desktop - Handling Ties using DAX measure/ RANK</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Power-BI-desktop-Handling-Ties-using-DAX-measure-RANK/m-p/4869447#M185650</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have a table with multiple fields like Activity_Id, Days, Counterparty, and many other fields. My requirement is to display only 1 record per activity _id (fetch only the record with maximum values in Days column). However, there could be duplicates even in the maximum row because of other fields. In this case, fetch any random row with maximum days. I have connected to a live model so cannot create calculated columns or tables. Only DAX measure should be used.Need a simplified DAX measure to create a latest record flag as shown in the example&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;TABLE&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;Activity_ID&lt;/TD&gt;&lt;TD&gt;Days&lt;/TD&gt;&lt;TD&gt;Counterparty&lt;/TD&gt;&lt;TD&gt;Is Latest Flag&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;1&lt;/TD&gt;&lt;TD&gt;2&lt;/TD&gt;&lt;TD&gt;A&lt;/TD&gt;&lt;TD&gt;0&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;1&lt;/TD&gt;&lt;TD&gt;3&lt;/TD&gt;&lt;TD&gt;A&lt;/TD&gt;&lt;TD&gt;0&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;1&lt;/TD&gt;&lt;TD&gt;3&lt;/TD&gt;&lt;TD&gt;B&lt;/TD&gt;&lt;TD&gt;1&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;2&lt;/TD&gt;&lt;TD&gt;4&lt;/TD&gt;&lt;TD&gt;A&lt;/TD&gt;&lt;TD&gt;0&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;2&lt;/TD&gt;&lt;TD&gt;6&lt;/TD&gt;&lt;TD&gt;B&lt;/TD&gt;&lt;TD&gt;1&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;3&lt;/TD&gt;&lt;TD&gt;7&lt;/TD&gt;&lt;TD&gt;A&lt;/TD&gt;&lt;TD&gt;1&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;</description>
      <pubDate>Fri, 07 Nov 2025 19:32:22 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Power-BI-desktop-Handling-Ties-using-DAX-measure-RANK/m-p/4869447#M185650</guid>
      <dc:creator>Amudha_Kumaran</dc:creator>
      <dc:date>2025-11-07T19:32:22Z</dc:date>
    </item>
    <item>
      <title>Re: Power BI desktop - Handling Ties using DAX measure/ RANK</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Power-BI-desktop-Handling-Ties-using-DAX-measure-RANK/m-p/4869457#M185651</link>
      <description>&lt;P&gt;Hi &lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="627817" data-lia-user-login="Amudha_Kumaran" class="lia-mention lia-mention-user"&gt;Amudha_Kumaran&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;&lt;P&gt;Please refer below DAX measure.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Is Latest Flag =&lt;/P&gt;&lt;P&gt;VAR _maxDays =&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; CALCULATE (&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; MAX ( 'Table'[Days] ),&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; ALLEXCEPT ( 'Table', 'Table'[Activity_ID] )&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; )&lt;/P&gt;&lt;P&gt;VAR _randomPick =&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; MINX (&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; FILTER (&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; ALL ( 'Table' ),&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 'Table'[Activity_ID] = MAX ( 'Table'[Activity_ID] )&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;amp;&amp;amp; 'Table'[Days] = _maxDays&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; ),&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 'Table'[Counterparty]&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; )&lt;/P&gt;&lt;P&gt;RETURN&lt;/P&gt;&lt;P&gt;IF (&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; 'Table'[Days] = _maxDays&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;amp;&amp;amp; 'Table'[Counterparty] = _randomPick,&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; 1,&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; 0&lt;/P&gt;&lt;P&gt;)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If my response as resolved your issue, please accept it as a solution and please give kudos.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Dinesh&lt;/P&gt;</description>
      <pubDate>Fri, 07 Nov 2025 19:58:08 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Power-BI-desktop-Handling-Ties-using-DAX-measure-RANK/m-p/4869457#M185651</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2025-11-07T19:58:08Z</dc:date>
    </item>
    <item>
      <title>Re: Power BI desktop - Handling Ties using DAX measure/ RANK</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Power-BI-desktop-Handling-Ties-using-DAX-measure-RANK/m-p/4869458#M185652</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="627817" data-lia-user-login="Amudha_Kumaran" class="lia-mention lia-mention-user"&gt;Amudha_Kumaran&lt;/a&gt;,&amp;nbsp;&lt;BR /&gt;This is a common challenge in &lt;STRONG&gt;Live Connection&lt;/STRONG&gt; models where calculated columns are not allowed. The solution involves creating a &lt;STRONG&gt;DAX Measure&lt;/STRONG&gt; that acts as a row-level flag, determining if the current row holds the maximum Days value for its respective Activity_ID. &lt;STRONG&gt;Crucially, you must then apply this measure as a Visual Filter&lt;/STRONG&gt; on your table (set to where the value is &lt;STRONG&gt;1&lt;/STRONG&gt;) to display only the latest records.&lt;BR /&gt;&lt;BR /&gt;Try this:&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;Is Latest Flag =
VAR CurrentActivityID = MAX('YourTable'[Activity_ID])
VAR CurrentDays = MAX('YourTable'[Days])
VAR MaxDaysForActivity =
    CALCULATE(
        MAX('YourTable'[Days]),
        ALL('YourTable'[Days], 'YourTable'[Counterparty]), -- Remove row-level context filters
        'YourTable'[Activity_ID] = CurrentActivityID       -- Keep filter for the current Activity_ID
    )
RETURN
    IF(
        CurrentDays = MaxDaysForActivity,
        1, -- Latest record
        0  -- Not the latest record
    )&lt;/LI-CODE&gt;&lt;P&gt;&lt;BR /&gt;If this post helps, then please consider &lt;STRONG&gt;Accepting it as the solution&lt;/STRONG&gt; to help the other members find it more quickly. Appreciate your &lt;STRONG&gt;KUDO&lt;/STRONG&gt; if you find it useful.&lt;/P&gt;</description>
      <pubDate>Fri, 07 Nov 2025 20:08:03 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Power-BI-desktop-Handling-Ties-using-DAX-measure-RANK/m-p/4869458#M185652</guid>
      <dc:creator>Zanqueta</dc:creator>
      <dc:date>2025-11-07T20:08:03Z</dc:date>
    </item>
    <item>
      <title>Re: Power BI desktop - Handling Ties using DAX measure/ RANK</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Power-BI-desktop-Handling-Ties-using-DAX-measure-RANK/m-p/4869470#M185654</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="861055" data-lia-user-login="Zanqueta" class="lia-mention lia-mention-user"&gt;Zanqueta&lt;/a&gt;&amp;nbsp;,&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks for the quick response. I still don't see the current flags. All are showing 1&lt;/P&gt;</description>
      <pubDate>Fri, 07 Nov 2025 20:24:06 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Power-BI-desktop-Handling-Ties-using-DAX-measure-RANK/m-p/4869470#M185654</guid>
      <dc:creator>Amudha_Kumaran</dc:creator>
      <dc:date>2025-11-07T20:24:06Z</dc:date>
    </item>
    <item>
      <title>Re: Power BI desktop - Handling Ties using DAX measure/ RANK</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Power-BI-desktop-Handling-Ties-using-DAX-measure-RANK/m-p/4869510#M185656</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="627817" data-lia-user-login="Amudha_Kumaran" class="lia-mention lia-mention-user"&gt;Amudha_Kumaran&lt;/a&gt;&amp;nbsp;,&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;Thanks for the feedback. If the measure is consistently returning &lt;STRONG&gt;1&lt;/STRONG&gt; for every row, it usually means that the &lt;STRONG&gt;Row Context&lt;/STRONG&gt; is not being properly filtered &lt;I&gt;or&lt;/I&gt; the MaxDaysForActivity calculation is incorrectly seeing the same Days value as the current row.&lt;/P&gt;&lt;P&gt;The most robust way to ensure the calculation ignores the row-level filters (like the specific values of Days and Counterparty for that row) is to use ALL('YourTable') inside the CALCULATE to clear all internal table filters, and then explicitly re-apply the filter for the current Activity_ID.&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;BR /&gt;maybe you can try:&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;Is Latest Flag =
VAR CurrentActivityID = MAX('YourTable'[Activity_ID])
VAR CurrentDays = MAX('YourTable'[Days])
VAR MaxDaysForActivity =
    CALCULATE(
        MAX('YourTable'[Days]),
        ALL('YourTable'),                                  -- Clear all filters from the table
        KEEPFILTERS('YourTable'[Activity_ID] = CurrentActivityID) -- Only keep the filter for the current Activity_ID
    )
RETURN
    IF(
        CurrentDays = MaxDaysForActivity,
        1, -- Latest record
        0  -- Not the latest record
    )&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 07 Nov 2025 21:30:41 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Power-BI-desktop-Handling-Ties-using-DAX-measure-RANK/m-p/4869510#M185656</guid>
      <dc:creator>Zanqueta</dc:creator>
      <dc:date>2025-11-07T21:30:41Z</dc:date>
    </item>
    <item>
      <title>Re: Power BI desktop - Handling Ties using DAX measure/ RANK</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Power-BI-desktop-Handling-Ties-using-DAX-measure-RANK/m-p/4869515#M185657</link>
      <description>&lt;P&gt;Hi&amp;nbsp;Anonymous&lt;/a&gt;,&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="474658" data-lia-user-login="ThxAlot" class="lia-mention lia-mention-user"&gt;ThxAlot&lt;/a&gt;&amp;nbsp; &amp;amp;&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="861055" data-lia-user-login="Zanqueta" class="lia-mention lia-mention-user"&gt;Zanqueta&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks for your responses. I have somehow created a measure to find the latest record with max days. But, there are duplicates with same activity id, max days &amp;amp; counterparty. There is no other unique field in the table to use for tie-breaking. This is where I'm stuck. Trying to handle ties in the latest record&lt;/P&gt;</description>
      <pubDate>Mon, 10 Nov 2025 06:07:28 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Power-BI-desktop-Handling-Ties-using-DAX-measure-RANK/m-p/4869515#M185657</guid>
      <dc:creator>Amudha_Kumaran</dc:creator>
      <dc:date>2025-11-10T06:07:28Z</dc:date>
    </item>
    <item>
      <title>Re: Power BI desktop - Handling Ties using DAX measure/ RANK</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Power-BI-desktop-Handling-Ties-using-DAX-measure-RANK/m-p/4869576#M185660</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="627817" data-lia-user-login="Amudha_Kumaran" class="lia-mention lia-mention-user"&gt;Amudha_Kumaran&lt;/a&gt;&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;Now, it worked:&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;Is Latest Flag = 
VAR CurrentActivityID = MAX('tbl'[Activity_ID])
VAR CurrentDays = MAX('tbl'[Days])
VAR CurrentCounterparty = MAX('tbl'[Counterparty])

VAR MaxDaysForActivity =
    CALCULATE(
        MAX(tbl[Days]),
        ALL(tbl),
        KEEPFILTERS(tbl[Activity_ID] = CurrentActivityID)
    )

VAR MaxCounterpartyForMaxDays =
    CALCULATE(
        MAXX(
            FILTER(
                ALL(tbl),
                tbl[Activity_ID] = CurrentActivityID
                &amp;amp;&amp;amp; tbl[Days] = MaxDaysForActivity  -- Filtra apenas linhas com o Max Days
            ),
            tbl[Counterparty]
        )
    )

RETURN
    IF(
        CurrentDays = MaxDaysForActivity &amp;amp;&amp;amp; CurrentCounterparty = MaxCounterpartyForMaxDays,
        1, -- Latest record (Max Days AND Max Counterparty)
        0  -- Not the latest record
    )&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;HR /&gt;&lt;P&gt;If this post helps, then please consider &lt;STRONG&gt;Accepting it as the solution&lt;/STRONG&gt; to help the other members find it more quickly. Appreciate your &lt;STRONG&gt;KUDO&lt;/STRONG&gt; if you find it useful.&lt;/P&gt;</description>
      <pubDate>Fri, 07 Nov 2025 23:06:23 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Power-BI-desktop-Handling-Ties-using-DAX-measure-RANK/m-p/4869576#M185660</guid>
      <dc:creator>Zanqueta</dc:creator>
      <dc:date>2025-11-07T23:06:23Z</dc:date>
    </item>
    <item>
      <title>Re: Power BI desktop - Handling Ties using DAX measure/ RANK</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Power-BI-desktop-Handling-Ties-using-DAX-measure-RANK/m-p/4869599#M185663</link>
      <description>&lt;P&gt;Hi &lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="627817" data-lia-user-login="Amudha_Kumaran" class="lia-mention lia-mention-user"&gt;Amudha_Kumaran&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;&lt;P&gt;Please refer below updated Dax.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Is Latest Flag =&lt;/P&gt;&lt;P&gt;VAR _maxDays =&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; CALCULATE(&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; MAX('Table'[Days]),&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; ALLEXCEPT('Table', 'Table'[Activity_ID])&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; )&lt;/P&gt;&lt;P&gt;VAR _candidateRows =&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; FILTER(&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; ALL('Table'),&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 'Table'[Activity_ID] = MAX('Table'[Activity_ID])&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;amp;&amp;amp; 'Table'[Days] = _maxDays&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; )&lt;/P&gt;&lt;P&gt;VAR _chosenRow =&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; MINX(&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; ADDCOLUMNS(&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; _candidateRows,&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; "@key",&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; CONCATENATE(&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 'Table'[Activity_ID],&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 'Table'[Days] &amp;amp; 'Table'[Counterparty]&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; )&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; ),&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; [@key]&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; )&lt;/P&gt;&lt;P&gt;VAR _thisRowKey =&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; CONCATENATE(&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 'Table'[Activity_ID],&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 'Table'[Days] &amp;amp; 'Table'[Counterparty]&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; )&lt;/P&gt;&lt;P&gt;RETURN&lt;/P&gt;&lt;P&gt;IF(_thisRowKey = _chosenRow, 1, 0)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If my response as resolved your issue, please accept it as a solution and please give kudos.&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;Thanks,&lt;/P&gt;&lt;P&gt;Dinesh&lt;/P&gt;</description>
      <pubDate>Fri, 07 Nov 2025 23:39:42 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Power-BI-desktop-Handling-Ties-using-DAX-measure-RANK/m-p/4869599#M185663</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2025-11-07T23:39:42Z</dc:date>
    </item>
    <item>
      <title>Re: Power BI desktop - Handling Ties using DAX measure/ RANK</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Power-BI-desktop-Handling-Ties-using-DAX-measure-RANK/m-p/4869606#M185664</link>
      <description>&lt;P&gt;Easy enough,&lt;/P&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If you were able to wrap your head around this measure, DAX is almost no secret for you.&lt;/P&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 07 Nov 2025 23:47:24 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Power-BI-desktop-Handling-Ties-using-DAX-measure-RANK/m-p/4869606#M185664</guid>
      <dc:creator>ThxAlot</dc:creator>
      <dc:date>2025-11-07T23:47:24Z</dc:date>
    </item>
    <item>
      <title>Re: Power BI desktop - Handling Ties using DAX measure/ RANK</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Power-BI-desktop-Handling-Ties-using-DAX-measure-RANK/m-p/4870453#M185682</link>
      <description>&lt;P&gt;Hi&amp;nbsp;Anonymous&lt;/a&gt;&amp;nbsp; &amp;amp;&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="861055" data-lia-user-login="Zanqueta" class="lia-mention lia-mention-user"&gt;Zanqueta&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks a lot for your responses. However, I found that even counterparty is not a differentiating field in many cases. Duplicates could be due to many other fields. Whatever the case may be, we need only one row for each Activity ID with maximum days. And the issue is, there is no unique row identifier.&lt;/P&gt;</description>
      <pubDate>Mon, 10 Nov 2025 04:50:39 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Power-BI-desktop-Handling-Ties-using-DAX-measure-RANK/m-p/4870453#M185682</guid>
      <dc:creator>Amudha_Kumaran</dc:creator>
      <dc:date>2025-11-10T04:50:39Z</dc:date>
    </item>
    <item>
      <title>Re: Power BI desktop - Handling Ties using DAX measure/ RANK</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Power-BI-desktop-Handling-Ties-using-DAX-measure-RANK/m-p/4893021#M186223</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="627817" data-lia-user-login="Amudha_Kumaran" class="lia-mention lia-mention-user"&gt;Amudha_Kumaran&lt;/a&gt;&amp;nbsp;,&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;
&lt;P&gt;Thanks for the clarification. Based on the behavior you’re seeing, it’s clear that Activity_ID, Days, Counterparty, and all other columns can still repeat, meaning there is no unique row identifier anywhere in the model. When that happens, DAX has no way to distinguish those duplicate rows. A measure can only evaluate values at the column level, it cannot see the underlying physical row or row order inside the engine. Because of this, DAX cannot reliably “pick one random row” when two or more rows are completely identical across every available column.&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;
&lt;P&gt;Since you are also working with a Live Connection, calculated columns and calculated tables are not an option. That leaves only two feasible and supportable solutions:&lt;/P&gt;
&lt;P&gt;1. Add a surrogate key / row identifier in the source model&lt;BR /&gt;2. Adjust the requirement to a higher grain&lt;/P&gt;
&lt;P&gt;If you can add that key, I can provide a clean, simplified RANK-based measure that will give you exactly one Max-Days row per Activity_ID.&lt;BR /&gt;&lt;BR /&gt;Hope this helps.&lt;BR /&gt;Thank you.&lt;/P&gt;</description>
      <pubDate>Thu, 04 Dec 2025 11:32:05 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Power-BI-desktop-Handling-Ties-using-DAX-measure-RANK/m-p/4893021#M186223</guid>
      <dc:creator>v-echaithra</dc:creator>
      <dc:date>2025-12-04T11:32:05Z</dc:date>
    </item>
    <item>
      <title>Re: Power BI desktop - Handling Ties using DAX measure/ RANK</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Power-BI-desktop-Handling-Ties-using-DAX-measure-RANK/m-p/4895816#M186320</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="627817" data-lia-user-login="Amudha_Kumaran" class="lia-mention lia-mention-user"&gt;Amudha_Kumaran&lt;/a&gt;&amp;nbsp;,&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;
&lt;P&gt;I just wanted to check if the issue has been resolved on your end, or if you require any further assistance.&amp;nbsp;&lt;SPAN&gt;&amp;nbsp;Kindly share a sample of the data for further investigation.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Need help uploading data?&amp;nbsp;&lt;/SPAN&gt;&lt;A href="https://community.fabric.microsoft.com/t5/Community-Blog/How-to-provide-sample-data-in-the-Power-BI-Forum/ba-p/963216" target="_blank" rel="noopener"&gt;https://community.fabric.microsoft.com/t5/Community-Blog/How-to-provide-sample-data-in-the-Power-BI-...&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Best Regards,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Chaithra E.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;Thank you&amp;nbsp;&lt;BR /&gt;Chaithra E.&lt;/P&gt;</description>
      <pubDate>Wed, 07 Jan 2026 05:51:12 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Power-BI-desktop-Handling-Ties-using-DAX-measure-RANK/m-p/4895816#M186320</guid>
      <dc:creator>v-echaithra</dc:creator>
      <dc:date>2026-01-07T05:51:12Z</dc:date>
    </item>
    <item>
      <title>Re: Power BI desktop - Handling Ties using DAX measure/ RANK</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Power-BI-desktop-Handling-Ties-using-DAX-measure-RANK/m-p/4899586#M186404</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="627817" data-lia-user-login="Amudha_Kumaran" class="lia-mention lia-mention-user"&gt;Amudha_Kumaran&lt;/a&gt;&amp;nbsp;,&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;
&lt;P&gt;May I ask if you have resolved this issue? Please let us know, if you have any further issues please provide the sample data, we are happy to help.&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;
&lt;P&gt;Thank you.&lt;/P&gt;</description>
      <pubDate>Wed, 07 Jan 2026 05:51:38 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Power-BI-desktop-Handling-Ties-using-DAX-measure-RANK/m-p/4899586#M186404</guid>
      <dc:creator>v-echaithra</dc:creator>
      <dc:date>2026-01-07T05:51:38Z</dc:date>
    </item>
  </channel>
</rss>

