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! Get ahead of the game and start preparing now! Learn more
Hello, I hope this time you can also help me.
I have two related tables and I need to create a calculated column depending on one condition in the second table.
I need to add the new column in the Table1 Opportunities with the Stage name of the Table2 Stages with the Max value on "Stage first starting date"
Table 1. Opportunities
| Opportunity ID | Opportunity name | Status | Stage name |
| 1002 | ABCD | Active | |
| 1003 | EFGH | Declined | |
| 1004 | IJKL | On Hold |
Table 2 Stages
| Opportunity ID | Stage name | Start date |
| 1002 | Initial | 1/2/2022 |
| 1002 | Triage | 1/7/2023 |
| 1002 | Discovery | 4/5/2023 |
| 1002 | Negotiation | 4/5/2022 |
| 1003 | Screening | 1/12/2020 |
| 1003 | Triage | 3/5/2022 |
| 1003 | Full Assessment | 3/5/2024 |
The result I'm expecting in Table 1 is :
| Opportunity ID | Opportunity name | Status | Stage name |
| 1002 | ABCD | Active | 4/5/2023 |
| 1003 | EFGH | Declined | 3/5/2024 |
| 1003 | IJKL | On Hold |
Thank you so much in advance.
Solved! Go to Solution.
@mcantos ,Please find the updated measure
Proud to be a Super User! |
|
@mcantos , Use this measure and your output is incorrect as First Max date is 1/07/2023 for oppurtunity id 1002
Proud to be a Super User! |
|
Thank you for your replay,
Actually I made a mistake in the post. The result I'm expecting is th stage name instead of the date.
Sorry and thank you again.
@mcantos ,Please find the updated measure
Proud to be a Super User! |
|
Thanks a lot @bhanu_gautam , that was fast.
It worked!! But now I have a situation where the max of the date does not work for some records and I have to select the second max date of the stage table.
Should I mark this as a solution and open a new ticket ?
Thank you again!
Yes you should open new ticket with complete scenario , where you need to use second highest value
Proud to be a Super User! |
|
The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!
Check out the November 2025 Power BI update to learn about new features.
| User | Count |
|---|---|
| 59 | |
| 43 | |
| 42 | |
| 23 | |
| 17 |
| User | Count |
|---|---|
| 190 | |
| 122 | |
| 96 | |
| 66 | |
| 46 |