Forum Discussion
Is this IF statement possible?
- 1 year ago
bonjourposte Create a concatenated field for Borrowers, Financial Contacts, and Guarantors: If your data is structured such that Borrower, Financial Contacts, and Guarantors are in separate columns, you could create a new column that combines all of these into a single one for each row, making it easier to look for duplicate names.
CombinedNames = [Borrower] & "," & [FinancialContacts] & "," & [Guarantors]
If you want to break the concatenated column into separate names and count their occurrences, you would need to either use Power Query to split the names into rows or use a more complex DAX formula. A simple way is to count occurrences of a name within the combined column.
Count the number of loans per name: Create a measure or calculated column to count how many times each name appears across all rows (loans).
LoanCountPerName = CALCULATE(
COUNTROWS(Loans),
FILTER(
Loans,
CONTAINSSTRING([CombinedNames], [Name])
)
)Create another calculated column to flag whether a borrower, financial contact, or guarantor is a major borrower (more than 3 loans).
IsMajorBorrower = IF([LoanCountPerName] > 3, 1, 0)
Finally, you can use this flag to sort your data into two piles (Mail Merge or Major Borrower).
bonjourposte Create a concatenated field for Borrowers, Financial Contacts, and Guarantors: If your data is structured such that Borrower, Financial Contacts, and Guarantors are in separate columns, you could create a new column that combines all of these into a single one for each row, making it easier to look for duplicate names.
CombinedNames = [Borrower] & "," & [FinancialContacts] & "," & [Guarantors]
If you want to break the concatenated column into separate names and count their occurrences, you would need to either use Power Query to split the names into rows or use a more complex DAX formula. A simple way is to count occurrences of a name within the combined column.
Count the number of loans per name: Create a measure or calculated column to count how many times each name appears across all rows (loans).
LoanCountPerName = CALCULATE(
COUNTROWS(Loans),
FILTER(
Loans,
CONTAINSSTRING([CombinedNames], [Name])
)
)
Create another calculated column to flag whether a borrower, financial contact, or guarantor is a major borrower (more than 3 loans).
IsMajorBorrower = IF([LoanCountPerName] > 3, 1, 0)
Finally, you can use this flag to sort your data into two piles (Mail Merge or Major Borrower).
Awesome, thanks, I'll give it a try.