Forum Discussion

MKumar_17's avatar
MKumar_17
Icon for Helper I rankHelper I
1 year ago
Solved

How to add a dynamic index in a table

Hi , I have added a series values field with the help of transform data. As shown in below snapshot :     But it is not showing correct asending order once I used this index no in a table w...
  • Anonymous's avatar
    Anonymous
    1 year ago

    Hi MKumar_17 ,
    Based on your description, you want to sort the visualized data while preserving the current filters. You have created an index column in the power query, which just adds a fixed column to the data that cannot be influenced by the slicer. As zenisekd  said, you can create a MEASURE, which will enable dynamic adjustments. For the expression you provided, here is the revised version

    Rank = 
    RANKX(
        ALLSELECTED(Superstore_Orders),
        CALCULATE(SUM(Superstore_Orders[Sales])),
        ,
        ASC,
        Dense
    )

    Final output

     

    Best regards,
    Albert He


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