Forum Discussion
Calculated Column Based on two tables
I have two tables:
Table 1
| Name | |
| John Doe | [email protected] |
| John Doe | [email protected] |
| Larry Fitz | [email protected] |
| John Elway | [email protected] |
| John Elway | [email protected] |
| John Elway | [email protected] |
Table 2
| Name | Date Submitted | |
| John Elway | [email protected] | 1/1/2023 |
| Joe Burrow | [email protected] | 5/1/2022 |
| Larry Fitz | [email protected] | 12/1/2022 |
| Brian Urlacher | [email protected] | 9/1/2022 |
I want to create a new column using DAX on Table 1 called "Eligibility" where:
IF the inidivudla has a submission on Table 2 from the past 3 months, it says "Yes", other wise "No".
Intended Result would be:
| Name | Eligibility | |
| John Doe | [email protected] | No |
| John Doe | [email protected] | No |
| Larry Fitz | [email protected] | Yes |
| John Elway | [email protected] | Yes |
| John Elway | [email protected] | Yes |
| John Elway | [email protected] | Yes |
Thank you in advance!
- Anonymous3 years ago
Hi botaac ,
Please try to create a new column with below dax formula:
Eligibility = VAR cur_date = TODAY () VAR _date = LOOKUPVALUE ( Table2[Date Submitted], Table2[Name], Table1[Name] ) VAR _val = DATEDIFF ( cur_date, _date, MONTH ) RETURN IF ( ISBLANK ( _date ), "No", IF ( _val > 3, "No", "Yes" ) )Please refer the attached .pbix file.
Best regards,
Community Support Team_Binbin Yu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
2 Replies
- AnonymousNot applicable
Hi botaac ,
Please try to create a new column with below dax formula:
Eligibility = VAR cur_date = TODAY () VAR _date = LOOKUPVALUE ( Table2[Date Submitted], Table2[Name], Table1[Name] ) VAR _val = DATEDIFF ( cur_date, _date, MONTH ) RETURN IF ( ISBLANK ( _date ), "No", IF ( _val > 3, "No", "Yes" ) )Please refer the attached .pbix file.
Best regards,
Community Support Team_Binbin Yu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.