Forum Discussion
Count Rows When a Value occurs more than X times
- 4 years ago
This is what I'm getting:
How is your model set up and which fields are you using in the visual?
I have two tables, one is customers and the other is calendar, this second from which I filter the dates.
If I use a table as a visual I can just count the rows and with the filters pane I can select a simple measure of count rows of the customer table and select the ones that are greater than 2, this works in a table.
The problem is that I also need to use a card in which the filter pane doesn't work, what I'm trying to do is create a measure for the card visual.
Please let me know if it's clear.
- PaulDBrown4 years ago
Community Champion
Ok, 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])- AndresOH4 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: