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:
AndresOH
4 years agoFrequent Visitor
In this case, for example if I choose "April" and customer type = 1, the measure should show 2, because there are only 2 rows when an specific customer is shown 2 times or more in that month. If I choose june or customer type = 2 the measure should show 0 because there are no customer that appers 2 times in that period.
PaulDBrown
Community Champion
4 years agoOk. Try:
more than or equal 2 =
VAR _SelCust = MAX(Table[Customer])
VAR _CR = COUNTROWS(FILTER(ALLSELECTED(Table), Table[Customer] = _SelCust)
RETURN
COUNTROWS(FILTER(VALUES(Table[Customer]), _CR >= 2))
- AndresOH4 years agoFrequent Visitor
Thank you for your time Paul. This time it shows a blank always.