Forum Discussion
annade22
7 years agoNew Member
Count values within a groupby and filter
Hi, I hope someone can help me. I want to count the Categories per ParentProject and Group if at least one Category = SA. I the ParentProject/Group doesn't include any SA, then I don't want to ...
- 7 years ago
You may add the following measure.
Measure = COUNTROWS ( FILTER ( Table1, CONTAINS ( Table1, Table1[Group], Table1[Group], Table1[Category], "SA" ) ) ) + 0
AlB
Community Champion
7 years agoHi annade22
Try this:
1. Place ParentProject and Group in the rows of a matrix visual. Another option is to place ParentProject only in the visual and Group on a slicer
2. Create this measure and place it in the visual:
NumCategories = CALCULATE ( DISTINCTCOUNT ( Table1[Category] ), Table1[Category] <> "SA" )
annade22
7 years agoNew Member
Thankyou, it works to some extent, but I want to filter within a parentproject. The parentprojects that don't have any value of "SA" should be excluded from the formula completely.
Appreicate your help though!