Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started
Buenas tardes
Tengo una consulta, resulta que tengo una tabla con informacion pero no tiene un unico identificador que esta en mi base de datos postgres, uso esta informacion en mi modelo de power bi, que recomedaciones me podrian dar para generar un unico identificador que no cambie al momento de volver a exportar la informacion a que genere una columna indece pero cambia en cada nueva exportacion ?
Solved! Go to Solution.
Hi,@IDTS I am glad to help you.
There are several ways to create a sorting sequence
If you can, we recommend that you start directly in the database itself, by creating a timestamp or using a UUID. This may change the structure of your data (you need to add new columns), but it is very easy to manipulate the data in a way that meets your needs.
If you don't want to change the data source you are currently using, you can also try to manipulate the data in Power BI desktop: create a new index column in Power Query.
like this:
Or you can create new calculated columns for sorting with DAX code (but you will need to repeat this each time you import data and create a new report).
You can use the RANKX function or the ROWNUMBER function to create new columns.
like this:
IndexID = RANKX(ALL('Table'), 'Table'[Column1] & 'Table'[Column2], , ASC, DENSE)
url:
ROWNUMBER function (DAX) - DAX | Microsoft Learn
RANKX function (DAX) - DAX | Microsoft Learn
This way is not as direct and convenient as adding sequences directly in the database, and I would recommend making changes to the data source itself.
I hope you can choose the appropriate way to realize your needs.
I hope my suggestions give you good ideas, if you have any more questions, please clarify in a follow-up reply.
Best Regards,
Carson Jian,
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi,@IDTS I am glad to help you.
There are several ways to create a sorting sequence
If you can, we recommend that you start directly in the database itself, by creating a timestamp or using a UUID. This may change the structure of your data (you need to add new columns), but it is very easy to manipulate the data in a way that meets your needs.
If you don't want to change the data source you are currently using, you can also try to manipulate the data in Power BI desktop: create a new index column in Power Query.
like this:
Or you can create new calculated columns for sorting with DAX code (but you will need to repeat this each time you import data and create a new report).
You can use the RANKX function or the ROWNUMBER function to create new columns.
like this:
IndexID = RANKX(ALL('Table'), 'Table'[Column1] & 'Table'[Column2], , ASC, DENSE)
url:
ROWNUMBER function (DAX) - DAX | Microsoft Learn
RANKX function (DAX) - DAX | Microsoft Learn
This way is not as direct and convenient as adding sequences directly in the database, and I would recommend making changes to the data source itself.
I hope you can choose the appropriate way to realize your needs.
I hope my suggestions give you good ideas, if you have any more questions, please clarify in a follow-up reply.
Best Regards,
Carson Jian,
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Check out the September 2024 Power BI update to learn about new features.
Learn from experts, get hands-on experience, and win awesome prizes.
User | Count |
---|---|
114 | |
106 | |
97 | |
38 | |
32 |
User | Count |
---|---|
152 | |
122 | |
76 | |
74 | |
47 |