Forum Discussion

MP_123's avatar
MP_123
Icon for Microsoft Employee rankMicrosoft Employee
10 years ago
Solved

find min value in DAX

hi

 

i have 3 slicers on my report:

1. Date

2. choose category

3. choose product

(product belong to one category)

when i choose specific product i want to see the minimum sales of my product's category. i mean, after i sliced, i want a measure one level up in hierarchy

how can i do it??

thanks!!

  • MP_123 - You are going to have to use one of the FILTER functions that changes context and create a measure using it. I would recommend:

     

    Something like ALLEXCEPT or ALL (Column[, Column[, …]]), might get you there:

    https://msdn.microsoft.com/en-us/library/ee634795.aspx

     

    The problem you are having is that since Product is a slicer, once you select it, the context of the report only includes that specific product. Thus, you need to remove the product from the context but keep all of the other filter contexts in place. Can't really do much else without some sample data. So, for example, ALL([Product]) as a filter should remove filters on [Product] column but keep all other context filters in place (your other slicers).

3 Replies

  • Greg_Deckler's avatar
    Greg_Deckler
    Icon for Community Champion rankCommunity Champion

    MP_123 - You are going to have to use one of the FILTER functions that changes context and create a measure using it. I would recommend:

     

    Something like ALLEXCEPT or ALL (Column[, Column[, …]]), might get you there:

    https://msdn.microsoft.com/en-us/library/ee634795.aspx

     

    The problem you are having is that since Product is a slicer, once you select it, the context of the report only includes that specific product. Thus, you need to remove the product from the context but keep all of the other filter contexts in place. Can't really do much else without some sample data. So, for example, ALL([Product]) as a filter should remove filters on [Product] column but keep all other context filters in place (your other slicers).

    • MP_123's avatar
      MP_123
      Icon for Microsoft Employee rankMicrosoft Employee

      Greg_Deckler - thank you , the ALL function was the solution.

       

      i have one more qustion,

      my table has a lot of sales transactions to each product, do you know how can i do "MIN" of SUM?

      i mean calculate (Min(sum(sales)),ALL(products)) doesnt work...

       

      thanks

  • alexpancakes's avatar
    alexpancakes
    Icon for Microsoft Employee rankMicrosoft Employee

    >> when i choose specific product i want to see the minimum sales of my product's category

     

    minimum sales of category aggregate by days? Or just the minimum transaction which is in you data?