Forum Discussion
Logical Count Function.
Please can you elborate and describe the 2 files.
Are you saying you have 2 files each with a list of dates and you want to count which dates are on table A but not on table B?
This will count dates on B but not on A
My count =
VAR lista = VALUES(tableA[date])
VAR listb = VALUES(tableB[date])
RETURN
COUNTROWS(
EXCEPT(listb, lista)
)
See Below: All of my tables are Related Direct Queires from SQL. I am wanting to track how many loans are in the application process.
To do so, I am using dates. So in my main database, I am wanting to know how many loans that have an application date, but do not have an assigned date.
- speedramps6 years agoSuper UserPlease conisder a solution like this which creates a list of assigned loans and compares it to a list of applications =
My count =VAR AssignedLoans =CALCULATETABLE(VALUES(LoanTable[LoanID]),FILTER(ALL(LoanTable),LoanTable[AssignedDate] <> BLANK() ))VAR Applications =VALUES(ApplicationsTable[LoanID])RETURNCOUNTROWS(EXCEPT( Applications, AssignedLoans))- Anonymous6 years agoNot applicable
This works almost exactly how I need it to, but I think I need to specify that the loan "has" to have an application date. Would I include that filter in the 2nd VAR?
Thank you for your help,
- speedramps6 years agoSuper User
Hi again TPN
Thank you for your kudos, I enjoyed helping you during lockdown
Sorry, I just assumed all the applications would have an application date.
You can change the 2nd var using CALCULATETABLE with FILTER to just get a list of applications with an application date, like this ...
My count =
VAR AssignedLoans =
CALCULATETABLE(VALUES(LoanTable[LoanID]),
FILTER(ALL(LoanTable),
LoanTable[AssignedDate] <> BLANK() ))VAR Applications =
CALCULATETABLE(VALUES(ApplicationsTable[LoanID]),
FILTER(ALL(ApplicationsTable),
ApplicationsTable[AppliedDate] <> BLANK() ))RETURN
COUNTROWS(
EXCEPT( Applications, AssignedLoans)
)