Forum Discussion

jpf5046's avatar
jpf5046
Icon for Helper I rankHelper I
9 years ago
Solved

Question regarding Box and Whisker filtering

This question from stack overflow:   http://stackoverflow.com/questions/40915576/power-bi-box-and-whisker-filter-with-an-if-statement.     Is it possible to run a filtering Dax formula through a...
  • jpf5046's avatar
    jpf5046
    9 years ago

    JPP was able to answer the question to completeness, on SO: http://stackoverflow.com/questions/40915576/power-bi-box-and-whisker-filter-with-an-if-statement/40931563#40931563

     

    He used the following formula: Filter Score = IF(CALCULATE(DISTINCTCOUNT(Courses[Score]), ALLEXCEPT(Courses, Courses[Course]))>4, MIN(Courses[Score]), BLANK())

     

    Which solved the issue, but if you want to make sure the measure reacts to filters on the page, you need to add to the ALLEXECPT portion of the formula. 

     

    So the final formula --- if you were to implement this in your own dataset --- probably looks more like the following: 

     

    Filter Score = IF(CALCULATE(DISTINCTCOUNT(Courses[Score]), ALLEXCEPT(Courses, Courses[Course], Courses[Session]))>4, MIN(Courses[Score]), BLANK())