Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now

Reply
Anonymous
Not applicable

Cómo crear un índice

Hola, me gustaría saber cómo crear un índice como index1 (consulte el ejemplo siguiente) y que para cada proyecto en DAX (columna calculada)

ProyectoPeríodo fiscalTargetDateindex1
A202001202008
A202002202008
A202003202008
A202004202008
A202005202008
A202006202008
A202007202008
A2020082020081
A2020092020082
A2020102020083
A2020112020084
A2020122020085
A2021012020086
A2021022020087
A2021032020088
A2021042020089
B202001202007
B202002202007
B202003202007
B202004202007
B202005202007
B202006202007
B2020072020071
B2020082020072
B2020092020073
B2020102020074
B2020112020075
B2020122020076
1 ACCEPTED SOLUTION

Hola @alepage ,

Pruebe este código para una columna calculada:

Index ? IF('Table'[Período fiscal] >'Tabla'[TargetDate], RANKX('Table', 'Table'[Proyecto] ? EARLIER('Table'[Proyecto]) && 'Tabla'[Período fiscal] > ?Tabla'[TargetDate]), 'Tabla'[Período fiscal],,ASC), BLANK())
Capture.PNG


Did I answer your question? Mark my post as a solution!

Proud to be a Super User!



View solution in original post

4 REPLIES 4
parry2k
Super User
Super User

@alepage por qué hay valores vacíos en el índice? ¿Cuál es la lógica? Puede usar Rank para obtener el índice.

https://radacad.com/how-to-use-rankx-in-dax-part-1-of-3-calculated-columns

Me gustaría elogiossi mi solución ayudara.👉Si puedes pasar tiempo publicando la pregunta, también puedes hacer esfuerzos para dar a Kudos quien haya ayudado a resolver tu problema. ¡Es una muestra de agradecimiento!

Visítenos enhttps://perytus.com, su ventanilla única para proyectos/formación/consulta relacionados con Power BI.



Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!

Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo

If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤


Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.

Anonymous
Not applicable

Buena pregunta.

Si nos fijamos en el proyecto A, el período fiscal comienza a partir de 202001 y termina en 202104. Como puede ver, quiero el índice cuando el período fiscal es igual o mayor que la fecha de destino. Por lo tanto, en el proyecto A, la fecha objetivo es 202008, por lo que queremos un índice que comience en 1 para el período fiscal 202008 y el índice siga aumentando de uno hasta 202104. tenemos que hacer lo mismo para cada proyecto.

Hola @alepage ,

Pruebe este código para una columna calculada:

Index ? IF('Table'[Período fiscal] >'Tabla'[TargetDate], RANKX('Table', 'Table'[Proyecto] ? EARLIER('Table'[Proyecto]) && 'Tabla'[Período fiscal] > ?Tabla'[TargetDate]), 'Tabla'[Período fiscal],,ASC), BLANK())
Capture.PNG


Did I answer your question? Mark my post as a solution!

Proud to be a Super User!



Solución épica gracias por compartir!!

Helpful resources

Announcements
Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

Check out the October 2025 Power BI update to learn about new features.

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.