Forum Discussion

SteveCampbell's avatar
SteveCampbell
Memorable Member
7 years ago
Solved

Filter based on rank

For some reason can't work this out   I have a table with products 1,2,3,4,5,6 I can filter on any combination   I have another table with selected product, based on rank of the product ID   I...
  • v-jiascu-msft's avatar
    v-jiascu-msft
    7 years ago

    Hi SteveCampbell,

     

    Can you share a sample and the expected result? Especially the data structure. Please check out the demo in the attachment.

    Measure =
    VAR whichOne =
        SELECTEDVALUE ( selectedProducts[Selected] )
    RETURN
        MAXX (
            FILTER (
                SUMMARIZE (
                    'Products',
                    Products[ProductName],
                    "ranks", RANKX (
                        ALLSELECTED ( 'Products' ),
                        CALCULATE ( SUM ( Products[ProductID] ) ),
                        ,
                        ASC
                    )
                ),
                [ranks] = whichOne
            ),
            [ProductName]
        )
    

    Filter_based_on_rank

     

    Best Regards,

    Dale