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
Dn_wemn
Helper II
Helper II

COUNTROWS based on selected field

Hi all,

in this example I have created a measure that counts the amount of "Y" from the fields Flag Be, Flag Ce and Flag De which is 11.

Dn_wemn_1-1696239004959.png

Dn_wemn_2-1696239019881.png

If I want to select one or multiple Productgroups, the measure should only count the amount of Y from the correspondent Flag field. So if I select Productgroup = Be, the result of the measure should be 1, because only the 1 Y from the field Flag Be should be counted

Dn_wemn_3-1696239289167.png

If I select Be and Ce from Productgroup, the measure should only count the Y which has a match between Productgroup and Flag. So here the result should be 2.

Dn_wemn_4-1696239493412.png

 

Model:

Dn_wemn_6-1696239709087.png

1:1 relationship between the fields Account

 

Thank you for your help

 

 

1 REPLY 1
GilbertQ
Super User
Super User

Hi @Dn_wemn 

 

I would change the relationship from 1:1 to 1:Many (The many side being your table called "Table")

 

What should happen is if your visual should only show what you have selected in the slicer, which then should make your measure also only show the correct value?





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!







Power BI Blog

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!

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