Forum Discussion

Fernando232's avatar
Fernando232
Regular Visitor
2 years ago
Solved

Indice dinamico

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

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

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

  • Anonymous's avatar
    Anonymous
    2 years ago

    Hi, Fernando232 

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

    Based on your information, I create a sample table:

     

    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.

     

     

    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.

4 Replies

  • Anonymous's avatar
    Anonymous
    Not applicable

    Hi, Fernando232 

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

    Based on your information, I create a sample table:

     

    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.

     

     

    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.

    • Fernando232's avatar
      Fernando232
      Regular Visitor

      Hello Anonymous 

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

       
       
      • Fernando232's avatar
        Fernando232
        Regular Visitor

        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.