Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

View all the Fabric Data Days sessions on demand. View schedule

Reply
jpf5046
Helper I
Helper I

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 Box and Whisker plot?

 

So If I only want a Box and Whisker for values where distinct count is greater than 4, only those values will show up regardless of visual filters. 

1 ACCEPTED SOLUTION

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/409...

 

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())

View solution in original post

3 REPLIES 3
v-qiuyu-msft
Community Support
Community Support

Hi @jpf5046,

 

Based on my test, it's not supported to use Filter function within a measure (eg: Distinct count score = CALCULATE(AVERAGE(Courses[Score]),FILTER(Courses,DISTINCTCOUNT(Courses[Score])>4)) ) then use this measure to display values in a Box and Whisker chart. For this issue, I would suggest you contact the author of this custom visual for help. You can send the email to this address: mail@jppp.org.

 

Besides, I agree with Leonard's points in the stack overflow. To work around the issue, please create a calculated column to return distinct count of score for each course, then use this new column in Visual Lvel filter to filter values for the chart.

 

DistinctCount = CALCULATE(DISTINCTCOUNT(Courses[Score]),FILTER(Courses,EARLIER( Courses[Course] ) = 'Courses'[Course] ))

 

 

q1.PNGq2.PNG

 

Best Regards,
Qiuyun Yu

Community Support Team _ Qiuyun Yu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

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/409...

 

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())

Hi @jpf5046,

 

Glad to hear the issue has been solved. Smiley Happy Would you please mark a helpful reply as an answer, so that we can close the thread?

 

Best Regards,
Qiuyun Yu

Community Support Team _ Qiuyun Yu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Helpful resources

Announcements
November Power BI Update Carousel

Power BI Monthly Update - November 2025

Check out the November 2025 Power BI update to learn about new features.

Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Solution Authors
Top Kudoed Authors