Forum Discussion

flaviosouzaab's avatar
flaviosouzaab
Regular Visitor
4 years ago
Solved

Multi column order in pivot table

Hi,   I'm trying to do an apparently simple sort in a pivot table but I'm not getting it, here's the table format:   My goal is to sort the cluster column and the total column from hi...
  • v-henryk-mstf's avatar
    4 years ago

    Hi flaviosouzaab ,

     

    Try the following formula for group ranking:

     

    Sum = SUM(Sales[Volume])
    Combined Rank =
    RANKX (
        ALL ( Sales[Cluster] ),
        CALCULATE ( SELECTEDVALUE ( Sales[Cluster] ) ),
        ,
        ASC
    )
        + RANKX ( ALL ( Sales[Category] ), [Sum] )
            / ( CALCULATE ( DISTINCTCOUNT ( Sales[Category] ), ALL ( Sales ) ) + 1 )

     


    If the problem is still not resolved, please provide detailed error information and test data. Looking forward to your reply.


    Best Regards,
    Henry


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