Forum Discussion

Gerald23's avatar
Gerald23
Helper I
5 years ago
Solved

Top 3 Lowest value's

Hi Everyone,   I have a table that looks like this:   Product Number Online Shop Price 001 a.com 5,44 001 b.com 4,89 001 c.com 6,40 001 d.com 11,95 001 r.com 9.82 ...
  • mahoneypat's avatar
    5 years ago

    Here is one way to do it with a DAX measure in a Table visual with your Product Number and Online Store columns

     

    Lowest 3 Price =
    VAR thisProduct =
        MIN ( 'Price'[Product Number] )
    VAR lowest3 =
        TOPN (
            3,
            FILTER ( ALL ( 'Price' ), 'Price'[Product Number] = thisProduct ),
            'Price'[Price], ASC
        )
    VAR result =
        CALCULATE ( SUM ( 'Price'[Price] )KEEPFILTERS ( lowest3 ) )
    RETURN
        result

     

    Pat