Forum Discussion
AndresOH
4 years agoFrequent Visitor
Count Rows When a Value occurs more than X times
Hi everyone! I'am trying to count the rows in a table only when the code of a customer appears more than "x" times. In this particular case the number is 2. Taking as an example the table below, th...
- 4 years ago
This is what I'm getting:
PaulDBrown
Community Champion
4 years agoOk, this seems to work:
First an intermediate measure to count rows:
Customer rows >1 =
VAR _SelCust =
MAX ( FTable[Customer] )
VAR _CR =
COUNTROWS ( FILTER ( ALLSELECTED ( FTable ), FTable[Customer] = _SelCust ) )
RETURN
COUNTROWS ( FILTER ( FTable, _CR >= 2 ) )
And the final measure for the card:
Card Measure =
SUMX(FTable, [Customer rows >1])AndresOH
4 years agoFrequent Visitor
I'm not really sure why it's nor working, the first measure returns blank and about the card's one I get this message: "... the function SUMX cannot work with values of type boolean"
- PaulDBrown4 years ago
Community Champion
This is what I'm getting: