Forum Discussion
Anonymous
4 years agoNot applicable
Countrows as a filter within a CALCULATE function
Hello I'm facing a problem when filtering data inside a CALCULATE formula. What do I aim to do? To filter the people that appeared more than n times in my database (the highlighted part in my formul...
- 4 years ago
Not surprising there throws an error message. Filter 1,2,3 are based on row-level whereas filter 4 is an aggregation filter. Its SQL equivalent reads,
SELECT [assignee], COUNT(DISTINCT [assignee]) FROM BASE B JOIN Teste_Agents1 T ON B.[assignee]=T.[Nome] AND B.[Setor]=T.[Setor3] --row-level WHERE [assignee] IS NOT Null GROUP BY [assignee] HAVING COUNT([assignee])>7 --aggregation filterconversion of DAX measure,
= COUNTROWS( FILTER( CALCULATETABLE( VALUES( Base[assignee] ), filter1, filter2 ), CALCULATE( COUNTROWS( base ) > 7 ) && NOT ISBLANK( Base[assignee] ) ) )
Anonymous
4 years agoNot applicable
Appreciate your reply, @jdbuchanan71, but it didn't work. Is there any way I can do it inside the formula I showed in the image above?
jdbuchanan71
Super User
4 years agoYes, add the VAR that generates the list and use it in your CALCULATE. It is easier to work with your formulas if you paste them as text rather than a screenshot. You can paste them in a codeblock using this tag: