Forum Discussion
Problem counting number of rows when using Filter with AND-logic
- Anonymous3 years ago
Hi BJ_TS ,
I have created a simple sample, please refer to it to see if it helps you.
CountNumber = var _a = SELECTCOLUMNS('Table 2',"Certificate",[Certificate]) return CALCULATE(DISTINCTCOUNT('Table'[Person]),FILTER(ALL('Table'),[Certificate] in _a))Name = var _a = SUMMARIZE(ALL('Table'),[Person],"Flag",CALCULATE(COUNT('Table'[Certificate]),FILTER(ALL('Table'),[Certificate] in SELECTCOLUMNS('Table 2',"Certificate",[Certificate])&&[Person]=EARLIER('Table'[Person])))) var _b = COUNTROWS(ALLSELECTED('Table 2'[Certificate])) return MAXX(FILTER(_a,[Person]=SELECTEDVALUE('Table'[Person])&&[Flag]=_b),[Person])How to Get Your Question Answered Quickly
If it does not help, please provide more details with your desired output and pbix file without privacy information (or some sample data) .
Best Regards
Community Support Team _ RongtieIf this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi BJ_TS ,
I have created a simple sample, please refer to it to see if it helps you.
CountNumber =
var _a = SELECTCOLUMNS('Table 2',"Certificate",[Certificate])
return CALCULATE(DISTINCTCOUNT('Table'[Person]),FILTER(ALL('Table'),[Certificate] in _a))Name =
var _a = SUMMARIZE(ALL('Table'),[Person],"Flag",CALCULATE(COUNT('Table'[Certificate]),FILTER(ALL('Table'),[Certificate] in SELECTCOLUMNS('Table 2',"Certificate",[Certificate])&&[Person]=EARLIER('Table'[Person]))))
var _b = COUNTROWS(ALLSELECTED('Table 2'[Certificate]))
return MAXX(FILTER(_a,[Person]=SELECTEDVALUE('Table'[Person])&&[Flag]=_b),[Person])
How to Get Your Question Answered Quickly
If it does not help, please provide more details with your desired output and pbix file without privacy information (or some sample data) .
Best Regards
Community Support Team _ Rongtie
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.