Advance your Data & AI career with 50 days of live learning, dataviz contests, hands-on challenges, study groups & certifications and more!
Get registeredJoin 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.
If anyone could help me write a dax or power query formula for the two steps below I would greatly appreciate your knowledge.
1. If Column A has a duplicate value, and the value in Column B is the same, then return the record with the most recent date.
2. If Column A has a duplicate value, and the value in Column B is NOT the same, then keep both records.
I'm trying to achieve one formula that can account for both requirements. I've attached images of sample data to better explain. 

Solved! Go to Solution.
Could you please explain that why you have duplicate values for first row? I make a test using the following sample table instead, and create a measure in the table.
maxdate = MAX(Table[Date])
Regards,
Lydia
Could you please explain that why you have duplicate values for first row? I make a test using the following sample table instead, and create a measure in the table.
maxdate = MAX(Table[Date])
Regards,
Lydia
@Anonymous
I figured out the error. I was adding the table date column instead of maxdate. Your answer worked perfectly, thank you!
