Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.
Sign up nowGet Fabric certified for FREE! Don't miss your chance! Learn more
Hi Everyone,
My requirement is to create a new identifier column based on the combination of the two existing columns.
For Example, Let us consider this to be the Sample data. We need to create this ID (First column) based on the combination of "Country & PG" column.
| ID | Country | PG | Area | Action |
| 1 | C1 | P1 | A1 | TRUE |
| 2 | C1 | P1 | A2 | FALSE |
| 1 | C1 | P2 | A1 | TRUE |
| 2 | C1 | P2 | A2 | TRUE |
| 3 | C1 | P2 | A3 | FALSE |
| 1 | C1 | P3 | A1 | TRUE |
| 1 | C2 | P1 | A1 | TRUE |
| 2 | C2 | P1 | A2 | FALSE |
We need to increment the ID, if the combination of the Country and PG is same. If one of them seems to change, then again we need to start from the index 1. Can anyone please help me in implementing this ID column. It would be really helpful If you could able to give me the solution file or M code.
Thanks in advance!!
Solved! Go to Solution.
@Anonymous , First add index column in power query and then try a new column in dax
ID=
countx(filter(Table, [Country] =earlier([country]) && [PG] =earlier([PG]) && [index] <=earlier([index]) ), [index])
https://stackoverflow.com/questions/45715963/creating-an-index-column-for-power-bi
@Anonymous , First add index column in power query and then try a new column in dax
ID=
countx(filter(Table, [Country] =earlier([country]) && [PG] =earlier([PG]) && [index] <=earlier([index]) ), [index])
https://stackoverflow.com/questions/45715963/creating-an-index-column-for-power-bi
If you love stickers, then you will definitely want to check out our Community Sticker Challenge!
Check out the January 2026 Power BI update to learn about new features.
| User | Count |
|---|---|
| 65 | |
| 64 | |
| 49 | |
| 21 | |
| 18 |
| User | Count |
|---|---|
| 119 | |
| 117 | |
| 38 | |
| 36 | |
| 29 |