Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.
Register now!Learn from the best! Meet the four finalists headed to the FINALS of the Power BI Dataviz World Championships! Register now
Hi
I have one table DimEmployee with employee data and it contains column named Country . I want to create calculated column to generate unique key for each country. so in below example column like "CountryId". How to do this ?
Solved! Go to Solution.
Yes just use Rank
this will give them a unique id based on alphibetial order of country
Proud to be a Super User!
The easiest way to do this is to just add a manually entered table with ID and Country
you can the join on the country to get the id
if you are wanting to dynamically create an id because you do not know what the country names will be then use a RANKX colunm will give a unique number for each country
Proud to be a Super User!
I want to do it dynamically and I do not have any country table so I want to do this in DimEmployee itself. Is it doable ?
Yes just use Rank
this will give them a unique id based on alphibetial order of country
Proud to be a Super User!
Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.
Check out the February 2026 Power BI update to learn about new features.
| User | Count |
|---|---|
| 66 | |
| 60 | |
| 45 | |
| 19 | |
| 15 |
| User | Count |
|---|---|
| 108 | |
| 108 | |
| 41 | |
| 30 | |
| 27 |