Forum Discussion

bonjourposte's avatar
bonjourposte
Helper V
1 year ago
Solved

Is this IF statement possible?

I'm working in financials where we contact our borrowers once a year to ask for their financial reports, net worth statements, etc.  We do a big mail merge for the clients with 1 or 2 loans, but with...
  • bhanu_gautam's avatar
    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).