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

Join us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. Register now.

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
Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 Power BI Update Carousel

Power BI Monthly Update - June 2025

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

June 2025 community update carousel

Fabric Community Update - June 2025

Find out what's new and trending in the Fabric community.