Forum Discussion
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
Community 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
Microsoft 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
Microsoft 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?