Forum Discussion
Create ID from values in column
- 1 year ago
Heya,
For this kind of data (e.g. Products) it is adviceable to have a dedicated table with unique values so you can easily manage relationships and other calculations. If you don't already have one, then you can create a Products table using the code below (assuming that 'Table' is your dataset table):
Products = DISTINCT(SELECTCOLUMNS('Table',"Products",'Table'[Category))Then, you can simply add a calculated index column with the code:
Index = RANKX(ALL('Products'),'Products'[Products],,ASC)Hope it helps.
Hey Lewdis_ ,
in Power Query there is the function of an Index column.
But you would have to match the index then also in the fact table.
What is your data source? It would be a lot better if you could do it there, for example in the underlying relationan database.
If you need any help please let me know.
If I answered your question I would be happy if you could mark my post as a solution ✔️ and give it a thumbs up 👍
Best regards
Denis
Blog: WhatTheFact.bi
Follow me: twitter.com/DenSelimovic
Connect with me: LinkedIn