Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
2 years ago

Match non-unique ID from one table with multiple matches from another table

Hi I got a complicated problem and would appreciate any help/advice on how to approach it: Table 1 contains denied loan applications and Table 2 contains all risk alerts associated with certain custmers. Each risk alert covers certain time period with a start and end date. My task is to find out how many denied applications had active alerts in each denied date, and count the number of active alerts by alert type (delinquency, loss, security, etc.). Account # is unique but Customer ID is not. Each customer can have multiple loan applications and multiple risk alerts.

 

Sample date:

Table 1

Account #Customer IDDenied DateDenied Reason
101123410/20/2019A
123235608/23/2020B
234778902/23/2021C
546123408/23/2020A

 

Table 2

CustomerAlert TypeStart DateEnd Date
1234Delinquency07/20/201907/20/2019
2356 Loss08/23/202008/29/2020
7789Security02/23/202102/28/2021
1234Fraud08/22/201908/24/2020
1234Litigation08/20/201908/23/2020

2 Replies

  • Anonymous's avatar
    Anonymous
    Not applicable
    1. Thank you for your reply. I can't open this file since my Power BI version is older. I also got an error message saying that "The value for 'Customer ID' cannot be determined. Either the column doesn't exist, or there is no current row for this column." (assuming your suggestion is to create a measure). I updated the sample data to ensure there are at least two risk alerts for the same loan applications. Not sure if this is needed, but I cannot create a relationship between the two data tables since they do not have unique IDs.