Forum Discussion
jharsh
4 years agoFrequent Visitor
Count Rows In Table Default to 0 Returning to Many Results
I am trying to count the number of rows in a left join table defaulting to zero if there are none. When I do this the other table filters are no longer applied and I get all the records in the count...
- 4 years ago
Hi jharsh ,
I modify the formula, and it works fine now.
Show Sales Person in Table = var selectedManager = SELECTEDVALUE(Managers[Manager]) var currentOffice = SELECTEDVALUE(SalesPeople[Office]) var employeesManager = LOOKUPVALUE( Offices[Manager], Offices[Office], currentOffice ) return IF( employeesManager = selectedManager||NOT(ISFILTERED('Managers'[Manager])), 1 )I attach my sample below for reference.
Best Regards,
Community Support Team _ kalyjIf this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
johnt75
4 years agoSuper User
I think the below should work
CustomerCount = COALESCE( CALCULATE( COUNTROWS( Customers ) ), 0 )
The CALCULATE introduces context transition so should pick up the filter on manager
jharsh
4 years agoFrequent Visitor
Thanks for the feedback. Unfortunately, that formula still returns all results from the Customer table instead of the filtered by Manager results.