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

Grow your Fabric skills and prepare for the DP-600 certification exam by completing the latest Microsoft Fabric challenge.

Reply
Fernando232
Regular Visitor

Indice dinamico

Hola,
Por favor quisiera ayuda para poder crear una columna que funcione como un indice dinamico en mi reporte. 

Fernando232_1-1715718909340.png

Por ejemplo esta seria mi tabla y lo resaltado el indice que quiero implementar, pero cuando cambie algun filtro, el indice tambien. 

Fernando232_2-1715718956235.png

y este seria el resultado, el indice u orden siempre empieza desde 1 en forma descendente cuando se pone cualquier filtro

1 ACCEPTED SOLUTION
v-yohua-msft
Community Support
Community Support

Hi, @Fernando232 

Thanks for the reply from @lbendlin , please allow me to provide another insight:

Based on your information, I create a sample table:

vyohuamsft_0-1715825262825.png

 

You can create a measure to sort by one of your columns, and I'm just an example of how you can do it:

 

Index = RANKX(ALLSELECTED('Table'),CALCULATE(SUM('Table'[EDAD])),, DESC, Dense)

 

Regardless of the next selection, it will be sorted from 1.

vyohuamsft_1-1715825376139.png

 

vyohuamsft_2-1715825398909.png

 

How to Get Your Question Answered Quickly 

Best Regards

Yongkang Hua

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

4 REPLIES 4
v-yohua-msft
Community Support
Community Support

Hi, @Fernando232 

Thanks for the reply from @lbendlin , please allow me to provide another insight:

Based on your information, I create a sample table:

vyohuamsft_0-1715825262825.png

 

You can create a measure to sort by one of your columns, and I'm just an example of how you can do it:

 

Index = RANKX(ALLSELECTED('Table'),CALCULATE(SUM('Table'[EDAD])),, DESC, Dense)

 

Regardless of the next selection, it will be sorted from 1.

vyohuamsft_1-1715825376139.png

 

vyohuamsft_2-1715825398909.png

 

How to Get Your Question Answered Quickly 

Best Regards

Yongkang Hua

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Hello @v-yohua-msft 

Hello, your answer is very good, but if there are repeated values, the index also repeats.

 
 

You would need a unique value anyway, in this case you can use the newly created column "order" and that would theoretically solve the problem.

lbendlin
Super User
Super User

Read about Visual Calculations and ROWNUMBER

Helpful resources

Announcements
Europe Fabric Conference

Europe’s largest Microsoft Fabric Community Conference

Join the community in Stockholm for expert Microsoft Fabric learning including a very exciting keynote from Arun Ulag, Corporate Vice President, Azure Data.

RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

Ask questions in Eventhouse and KQL, Eventstream, and Reflex.

MayPowerBICarousel1

Power BI Monthly Update - May 2024

Check out the May 2024 Power BI update to learn about new features.