Forum Discussion

dfour's avatar
dfour
Regular Visitor
6 years ago
Solved

Dynamic row numbering for drill through table

Hello, 

So i have a database and i've applied certain filters on it to get drill through table visuals.

i need index number for each row in the table, i was trying all day but without any success

the row counts can be from 0 to 6K cols

 

This is the best i can get 

 

Current measure : 

btw when i apply the same measure to another table (having 1000+ cols) this is the result : 

  • Anonymous's avatar
    Anonymous
    5 years ago

    Hi dfour ,

     

    You may try this measure.

    RowNum = 
    CALCULATE (
        COUNT ( 'Table'[Emp Number] ),
        FILTER (
            ALLSELECTED ( 'Table' ),
            'Table'[Emp Number] <= MAX ( 'Table'[Emp Number] )
        )
    )

     

    You can check more details from here.


    Best Regards,
    Stephen Tao

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

5 Replies

  • AllisonKennedy's avatar
    AllisonKennedy
    Community Champion
    Looks like it might be a matter of counting the right table[column] combination. What does your data model look like? You could also just use COUNTROWS function and then don't need calculate.
    • dfour's avatar
      dfour
      Regular Visitor

      AllisonKennedy 

      i tried countrows before with no success

       

      The table takes filters from drill through and shows a visual table for employees with the filters applied

    • dfour's avatar
      dfour
      Regular Visitor

      amitchandak That will not work, because the table is just visual table with cols from different tables and results can be changed with filters

  • Anonymous's avatar
    Anonymous
    Not applicable

    Hi dfour ,

     

    You may try this measure.

    RowNum = 
    CALCULATE (
        COUNT ( 'Table'[Emp Number] ),
        FILTER (
            ALLSELECTED ( 'Table' ),
            'Table'[Emp Number] <= MAX ( 'Table'[Emp Number] )
        )
    )

     

    You can check more details from here.


    Best Regards,
    Stephen Tao

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