<?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 First Occurrence of a Value in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/First-Occurrence-of-a-Value/m-p/1960173#M42853</link>
    <description>&lt;P&gt;I want to create a new column with a 1 when the 1st occurence of the 'Occurrences UID' column happens, and the new column to have a 0 for all other instances. In excel the formula is:&amp;nbsp;=IF(COUNTIF($AO$2:AO2,AO2)&amp;gt;1,0,1). How could I accomplish this in Power BI?&amp;nbsp;&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;</description>
    <pubDate>Thu, 15 Jul 2021 14:40:37 GMT</pubDate>
    <dc:creator>djdubbert</dc:creator>
    <dc:date>2021-07-15T14:40:37Z</dc:date>
    <item>
      <title>First Occurrence of a Value</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/First-Occurrence-of-a-Value/m-p/1960173#M42853</link>
      <description>&lt;P&gt;I want to create a new column with a 1 when the 1st occurence of the 'Occurrences UID' column happens, and the new column to have a 0 for all other instances. In excel the formula is:&amp;nbsp;=IF(COUNTIF($AO$2:AO2,AO2)&amp;gt;1,0,1). How could I accomplish this in Power BI?&amp;nbsp;&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;</description>
      <pubDate>Thu, 15 Jul 2021 14:40:37 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/First-Occurrence-of-a-Value/m-p/1960173#M42853</guid>
      <dc:creator>djdubbert</dc:creator>
      <dc:date>2021-07-15T14:40:37Z</dc:date>
    </item>
    <item>
      <title>Re: First Occurrence of a Value</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/First-Occurrence-of-a-Value/m-p/1960323#M42863</link>
      <description>&lt;P&gt;How do you decide which is the first?&amp;nbsp; ie how is the list sorted?&lt;/P&gt;&lt;P&gt;In this example I'm sorting by a column called amt.&amp;nbsp; You can change that for however you want to sort it.&amp;nbsp; RANKX also has extra parameters for ordering ascending or descending if you need it.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;First = &lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;VAR _Current = 'Table'[Occurences UID]&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;VAR _Rank = &lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;RANKX(&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV class="lia-indent-padding-left-30px"&gt;&lt;SPAN&gt;FILTER('Table', &lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV class="lia-indent-padding-left-60px"&gt;&lt;SPAN&gt;'Table'[Occurences UID] = _Current&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV class="lia-indent-padding-left-60px"&gt;&lt;SPAN&gt;), &lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV class="lia-indent-padding-left-30px"&gt;&lt;SPAN&gt;'Table'[amt]&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV class="lia-indent-padding-left-30px"&gt;&lt;SPAN&gt;)&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;VAR _Result = IF(_Rank = 1, 1, 0)&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;RETURN&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV class="lia-indent-padding-left-30px"&gt;&lt;SPAN&gt;_Result&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/DIV&gt;</description>
      <pubDate>Thu, 15 Jul 2021 15:44:36 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/First-Occurrence-of-a-Value/m-p/1960323#M42863</guid>
      <dc:creator>PaulOlding</dc:creator>
      <dc:date>2021-07-15T15:44:36Z</dc:date>
    </item>
    <item>
      <title>Re: First Occurrence of a Value</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/First-Occurrence-of-a-Value/m-p/1960608#M42877</link>
      <description>&lt;P&gt;This worked! Thank you for your help!&lt;/P&gt;</description>
      <pubDate>Thu, 15 Jul 2021 18:07:26 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/First-Occurrence-of-a-Value/m-p/1960608#M42877</guid>
      <dc:creator>djdubbert</dc:creator>
      <dc:date>2021-07-15T18:07:26Z</dc:date>
    </item>
  </channel>
</rss>

