Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.
Register now!The Power BI Data Visualization World Championships is back! It's time to submit your entry. Live now!
Hello
I have two tables namely Contacts and Sales as shown in the example below. I wanted to create a calculated column (Contact after sales date) in Sales table such that only the immediate contact date after the sales date is pulled for each key as shown below. Can anyone suggest the code that could be used achieve this please? Thanks in advance.
| Contact Date | Key |
| 01/01/2022 | 1 |
| 16/01/2022 | 2 |
| 08/01/2022 | 3 |
| 29/01/2022 | 4 |
| 15/01/2022 | 1 |
| 02/02/2022 | 4 |
| 19/01/2022 | 3 |
| 30/01/2022 | 2 |
| Sales Date | Key | Contact after Sales date |
| 09/01/2022 | 1 | 15/01/2022 |
| 24/01/2022 | 2 | 30/01/2022 |
| 07/01/2022 | 3 | 08/01/2022 |
| 28/01/2022 | 4 | 29/01/2022 |
Solved! Go to Solution.
Hi @uc
Try this code to add a new column with dax:
Contact after Sales date =
CALCULATE (
MIN ( Contacts[Contact Date] ),
Contacts[Contact Date] > EARLIER ( Sales[Sales Date] )
)
Output:
If this post helps, please consider accepting it as the solution to help the other members find it more quickly.
Appreciate your Kudos!!
Hi @uc
Try this code to add a new column with dax:
Contact after Sales date =
CALCULATE (
MIN ( Contacts[Contact Date] ),
Contacts[Contact Date] > EARLIER ( Sales[Sales Date] )
)
Output:
If this post helps, please consider accepting it as the solution to help the other members find it more quickly.
Appreciate your Kudos!!
Thankyou so much 🙂
The Power BI Data Visualization World Championships is back! It's time to submit your entry.
Check out the January 2026 Power BI update to learn about new features.
| User | Count |
|---|---|
| 57 | |
| 40 | |
| 27 | |
| 25 | |
| 23 |
| User | Count |
|---|---|
| 127 | |
| 107 | |
| 54 | |
| 39 | |
| 33 |