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

Calling all Data Engineers! Fabric Data Engineer (Exam DP-700) live sessions are back! Starting October 16th. Sign up.

Reply
im_92
Frequent Visitor

filter within subject range

Hi community! 

 

I have the following table: 

 

subject numberquartilesymptom improvement
1Q1no
2Q1no
3Q1no
4Q1yes
1Q2no
2Q2yes
3Q2no
4Q2yes

 

Now I would like to visualise the number of subjects that did not have symptoms improvement in Q1 (which would be 3 in this example; subject 1,2,3), and how many of these do have symptom improvement in Q2 (which would be 1 in this example; subject 2). What's the best approach to do this? 

 

thanks! 

1 ACCEPTED SOLUTION
v-zhenbw-msft
Community Support
Community Support

Hi @im_92 ,

 

We can create two measures to meet your requirement.

 

Q1 no = 
CALCULATE(COUNT('Table'[symptom improvement]),FILTER('Table','Table'[quartile] = "Q1" && 'Table'[symptom improvement] = "no"))

 

Q2 improvement = 
var _Q2_no = 
CALCULATE(COUNT('Table'[symptom improvement]),FILTER('Table','Table'[quartile] = "Q2" && 'Table'[symptom improvement] = "no"))
return
[Q1 no] - _Q2_no

 

Filter1.jpg

 

If it doesn’t meet your requirement, could you please show the exact expected result based on the table that you have shared?

BTW, pbix as attached.

 

Best regards,

 

Community Support Team _ zhenbw

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

3 REPLIES 3
v-zhenbw-msft
Community Support
Community Support

Hi @im_92 ,

 

How about the result after you follow the suggestions mentioned in my original post?
Could you please provide more details or expected result about it If it doesn't meet your requirement?

 

Best regards,

 

Community Support Team _ zhenbw

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

v-zhenbw-msft
Community Support
Community Support

Hi @im_92 ,

 

We can create two measures to meet your requirement.

 

Q1 no = 
CALCULATE(COUNT('Table'[symptom improvement]),FILTER('Table','Table'[quartile] = "Q1" && 'Table'[symptom improvement] = "no"))

 

Q2 improvement = 
var _Q2_no = 
CALCULATE(COUNT('Table'[symptom improvement]),FILTER('Table','Table'[quartile] = "Q2" && 'Table'[symptom improvement] = "no"))
return
[Q1 no] - _Q2_no

 

Filter1.jpg

 

If it doesn’t meet your requirement, could you please show the exact expected result based on the table that you have shared?

BTW, pbix as attached.

 

Best regards,

 

Community Support Team _ zhenbw

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

az38
Community Champion
Community Champion

Hi @im_92 

try a measure

Measure = 
var _q2 = SELECTCOLUMNS(FILTER('Table', 'Table'[symptom improvement] = "no" && 'Table'[quartile] = "q1"), "subject", [subject number])
var _q1 = SELECTCOLUMNS(FILTER('Table', 'Table'[symptom improvement] = "yes" && 'Table'[quartile] = "q2"), "subject", [subject number])
RETURN
COUNTROWS(INTERSECT(_q1, _q2))

do not hesitate to give a kudo to useful posts and mark solutions as solution
LinkedIn

Helpful resources

Announcements
FabCon Global Hackathon Carousel

FabCon Global Hackathon

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!

September Power BI Update Carousel

Power BI Monthly Update - September 2025

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

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