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
LukasLK
New Member

Relationship between date columns in different tabels and comparting dates

Hello,

I have two tables including columns with data and project number among others. I need to create new column in one of the table as a result of comparison of dates in both tables. I am not able to do it. I tried couple of ways but it´s still complaining about relationships. When I created relationship between "ConvertedDate" and "Quotastion due Date" it create inactive relationship (I have already active relationship between project numbers). I tried to use USERELATIONSHIP in DAX, but still without success. Do you have any idea? I thought it´easy to do this, but I spent alredy way to much time on this... 
Here my formula:

QuotationStatus =
IF (
    USERELATIONSHIP('Table 1 (FEA History)'[ConvertedDate], 'PRF Decision'[Quotation due date]),
    IF (
        RELATED('PRF Decision'[Quotation due date]) > 'Table 1 (FEA History)'[ConvertedDate],
        "In Quotation",
        "After Quotation"
    ),
    BLANK()  -- Or any default value when the relationship is not active
)
 
For this, it returns:
The column 'PRF Decision[Quotation due date]' either doesn't exist or doesn't have a relationship to any table available in the current context.
1 ACCEPTED SOLUTION
tamerj1
Super User
Super User

Hi @LukasLK 
I'm not sure what exactly are expecting to get. However, please try

QuotationStatus =
IF (
    CALCULATE (
        MAX ( 'PRF Decision'[Quotation due date] ),
        USERELATIONSHIP ( 'Table 1 (FEA History)'[ConvertedDate], 'PRF Decision'[Quotation due date] )
    ) > 'Table 1 (FEA History)'[ConvertedDate],
    "In Quotation",
    "After Quotation"
)

View solution in original post

2 REPLIES 2
tamerj1
Super User
Super User

Hi @LukasLK 
I'm not sure what exactly are expecting to get. However, please try

QuotationStatus =
IF (
    CALCULATE (
        MAX ( 'PRF Decision'[Quotation due date] ),
        USERELATIONSHIP ( 'Table 1 (FEA History)'[ConvertedDate], 'PRF Decision'[Quotation due date] )
    ) > 'Table 1 (FEA History)'[ConvertedDate],
    "In Quotation",
    "After Quotation"
)

@tamerj1  seems you got it right. It works. Thank you. 

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.