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

Join us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. Register now.

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
Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 Power BI Update Carousel

Power BI Monthly Update - June 2025

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

June 2025 community update carousel

Fabric Community Update - June 2025

Find out what's new and trending in the Fabric community.