<?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: Create 3 digit sequential unique key in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Create-3-digit-sequential-unique-key/m-p/5148303#M187728</link>
    <description>&lt;P&gt;I would appreciate the ability to set a starting key, as some of the keys are already in use. I would like to have the ability to set a starting key. For example:&lt;/P&gt;&lt;P&gt;In the database, keys 001-003 are already taken. I have captured the last used key, 003, in a separate column, and I would like to input this 'last used key' into the query. Consequently, when the query initiates, it will assign 004 to the next row. Thank you.&lt;/P&gt;</description>
    <pubDate>Tue, 14 Apr 2026 11:53:32 GMT</pubDate>
    <dc:creator>jwb3d</dc:creator>
    <dc:date>2026-04-14T11:53:32Z</dc:date>
    <item>
      <title>Create 3 digit sequential unique key</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Create-3-digit-sequential-unique-key/m-p/5147141#M187703</link>
      <description>&lt;P&gt;I am new to Power BI. Currently, I have a key routine in MS Access that I am attempting to replicate in Power BI. I need to generate a sequential three-digit key for each row in a table. I am open to suggestions and hope that the example below will be helpful.&lt;/P&gt;&lt;P&gt;Example&lt;/P&gt;&lt;P&gt;keySet = Split("0,1,2,3,4,5,6,7,8,9,A,B,C,D,E,F,G,H,J,K,L,M,N,P,Q,R,S,T,U,V,W,X,Y,Z", ",")&lt;/P&gt;&lt;P&gt;KEY = 1CY&lt;/P&gt;&lt;P&gt;Begin with the third character in the key.&lt;/P&gt;&lt;P&gt;Search for the next available character in the keyset to assign to the third position. If found, replace Y with Z. FINISH.&lt;BR /&gt;Result: 1CZ.&lt;/P&gt;&lt;P&gt;If not found, the current column is "Z". Proceed to the second character in the key. You are looking for the next available character in the keyset to assign to the second position.&lt;/P&gt;&lt;P&gt;If found, replace C with D and set the third character in the third position to 0. Result: 1D0.&lt;/P&gt;&lt;P&gt;If not found, the current column is "Z". Move to the first character in the key. You are looking for the next available character in the keyset to assign to the first position.&lt;/P&gt;&lt;P&gt;If found, replace 1 with 2 and set the third character in the second position to 0. Result: 20Y.&lt;/P&gt;</description>
      <pubDate>Sat, 11 Apr 2026 20:29:21 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Create-3-digit-sequential-unique-key/m-p/5147141#M187703</guid>
      <dc:creator>jwb3d</dc:creator>
      <dc:date>2026-04-11T20:29:21Z</dc:date>
    </item>
    <item>
      <title>Re: Create 3 digit sequential unique key</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Create-3-digit-sequential-unique-key/m-p/5147765#M187714</link>
      <description>&lt;P&gt;the best way is with Power query , so&amp;nbsp;your idea: your keyset has 34 characters (0-9 plus letters minus I and O). So each row just needs a sequential number converted to base-34. Add an index column in Power Query (0, 1, 2...), then convert that number to base-34 using your keyset, and pad to 3 digits.&lt;BR /&gt;Something like this in Power Query as a custom column:&lt;BR /&gt;mlet&lt;BR /&gt;keyset = {"0","1","2","3","4","5","6","7","8","9","A","B","C","D","E","F","G","H","J","K","L","M","N","P","Q","R","S","T","U","V","W","X","Y","Z"},&lt;BR /&gt;n = [Index],&lt;BR /&gt;d1 = Number.IntegerDivide(n, 34*34),&lt;BR /&gt;d2 = Number.IntegerDivide(Number.Mod(n, 34*34), 34),&lt;BR /&gt;d3 = Number.Mod(n, 34)&lt;BR /&gt;in&lt;BR /&gt;keyset{d1} &amp;amp; keyset{d2} &amp;amp; keyset{d3}&lt;BR /&gt;That gives you 000 through ZZZ&amp;nbsp;&lt;/P&gt;&lt;P&gt;Hope it help !! &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 13 Apr 2026 14:21:22 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Create-3-digit-sequential-unique-key/m-p/5147765#M187714</guid>
      <dc:creator>Juan-Power-bi</dc:creator>
      <dc:date>2026-04-13T14:21:22Z</dc:date>
    </item>
    <item>
      <title>Re: Create 3 digit sequential unique key</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Create-3-digit-sequential-unique-key/m-p/5147957#M187717</link>
      <description>&lt;P&gt;I want to express my gratitude for this custom query. It functioned as intended. I would appreciate the ability to set a starting key, as some of the keys are already in use. I would like to have the ability to set a starting key. For example:&lt;/P&gt;&lt;P&gt;In the database, keys 001-003 are already taken. I have captured the last used key, 003, in a separate column, and I would like to input this 'last used key' into the query. Consequently, when the query initiates, it will assign 004 to the next row. Thank you.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 13 Apr 2026 21:06:04 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Create-3-digit-sequential-unique-key/m-p/5147957#M187717</guid>
      <dc:creator>jwb3d</dc:creator>
      <dc:date>2026-04-13T21:06:04Z</dc:date>
    </item>
    <item>
      <title>Re: Create 3 digit sequential unique key</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Create-3-digit-sequential-unique-key/m-p/5147978#M187718</link>
      <description>&lt;P&gt;Hard to full understand your explanation about coding logic; but here's an elegant way to build Base10, Base16 ... sytem&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;let
    UDF_Digit = (digits as list, bits) =&amp;gt;
        if bits&amp;lt;=1 then digits else List.TransformMany(digits, each @UDF_Digit(digits, bits-1), (x,y) =&amp;gt; x&amp;amp;y),
    Source = fx_Digit({"0".."9","A".."F"}, 3)
in
    Source&lt;/LI-CODE&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 13 Apr 2026 22:21:30 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Create-3-digit-sequential-unique-key/m-p/5147978#M187718</guid>
      <dc:creator>ThxAlot</dc:creator>
      <dc:date>2026-04-13T22:21:30Z</dc:date>
    </item>
    <item>
      <title>Re: Create 3 digit sequential unique key</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Create-3-digit-sequential-unique-key/m-p/5148303#M187728</link>
      <description>&lt;P&gt;I would appreciate the ability to set a starting key, as some of the keys are already in use. I would like to have the ability to set a starting key. For example:&lt;/P&gt;&lt;P&gt;In the database, keys 001-003 are already taken. I have captured the last used key, 003, in a separate column, and I would like to input this 'last used key' into the query. Consequently, when the query initiates, it will assign 004 to the next row. Thank you.&lt;/P&gt;</description>
      <pubDate>Tue, 14 Apr 2026 11:53:32 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Create-3-digit-sequential-unique-key/m-p/5148303#M187728</guid>
      <dc:creator>jwb3d</dc:creator>
      <dc:date>2026-04-14T11:53:32Z</dc:date>
    </item>
  </channel>
</rss>

