Forum Discussion

Dn_wemn's avatar
Dn_wemn
Icon for Helper II rankHelper II
2 years ago

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.

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

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.

 

Model:

1:1 relationship between the fields Account

 

Thank you for your help

 

 

1 Reply

  • 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?