Forum Discussion

ANILKORLIMARLA's avatar
ANILKORLIMARLA
Frequent Visitor
3 years ago
Solved

apply row number in table visual

i want to add row number to this table , The row number need to change as per the filter selection. i donot have any measure in this table   
  • Jihwan_Kim's avatar
    Jihwan_Kim
    3 years ago

     

    Hi,

    Thank you for your feedback.

    I fixed the measure like below.

    Please check the attached file as well.

    Thank you.

     

    Row number measure: = 
    VAR _newtable =
        ADDCOLUMNS (
            ALLSELECTED( Data ),
            "@Rankcategory",
                CALCULATE (
                    RANKX ( ALLSELECTED( Data ), CALCULATE ( MAX ( Data[Category] ) ),, asc, DENSE )
                ),
            "@Ranksubcategory",
                CALCULATE (
                    RANKX ( ALLSELECTED( Data ), CALCULATE ( MAX ( Data[Sub-Category] ) ),, asc, DENSE )
                )
        )
    VAR _newranking =
        ADDCOLUMNS (
            _newtable,
            "@newranking",
                RANKX ( _newtable, [@Rankcategory] * 100 + [@Ranksubcategory],, asc )
        )
    RETURN
        MAXX (
            FILTER (
                _newranking,
                Data[Category] = MAX ( Data[Category] )
                    && Data[Sub-Category] = MAX ( Data[Sub-Category] )
            ),
            [@newranking]
        )