Forum Discussion

francino's avatar
francino
Frequent Visitor
5 years ago
Solved

Count products below a user defined threshold

I am having trouble with getting a count of products below a user selected threshold.  Here is the scenario.  I have a table with products and their respective sales:   I calculate the averag...
  • amitchandak's avatar
    5 years ago

    francino , Try measure

     


    GT Threshold =
    var _t = calculate([Threshold], allselected(Table))
    return
    countx(values(table[product]), if([sales] > _T,[product], blank()))

     

    Below Threshold =
    var _t = calculate([Threshold], allselected(Table))
    return
    countx(values(table[product]), if([sales] <_T,[product], blank()))