Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
adoalan
Helper III
Helper III

Help with comparing two dates DAX

Hi,

 

Can you help me with the below formula.

I want to compare the two dates but is asking to use an agregation

 

adoalan_0-1676462964208.png

New Existing = IF(nfp_giftaiddeclaration[Created On] <= EDATE('contact'[Created On],1),
    "New",
    "Existing"
)
 
Many thanks
ADO
9 REPLIES 9
tamerj1
Super User
Super User

Hi @adoalan 
Is there a relationship between the two tables? Also please explain the logic behind this calculation.

adoalan_0-1676472360483.png

 

Hi @tamerj1 relationship in place.

 

The logic is if Created on from gift table <=with Created on from contact table then "New",
"Existing"

@adoalan 

Please create a calculated column in the gift table

New Existing = IF(nfp_giftaiddeclaration[Created On] <= RELATED('contact'[Created On]),
    "New",
    "Existing"
)

@adoalan 

Ok but is the logic behind using EDATE? Also in which table would ou like to create this column?

the formula was used in the past by someone else. It doesn t matter in what table.

FreemanZ
Super User
Super User

hi @adoalan 

Do you want to add a calculated column?

Are you really adding a calculated column

Hey @FreemanZ 

 

Whatever works, colm or measure.

 

Cheers

hi @adoalan 

try to use your code to create a calculated column. 

I tried but doesn t works

 

Helpful resources

Announcements
November Power BI Update Carousel

Power BI Monthly Update - November 2025

Check out the November 2025 Power BI update to learn about new features.

Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.