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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply
gwoodley
Frequent Visitor

Check if Dates are same, but only when another column value exists in another column.

Hi, I'm a little stuck here, I'm trying to compare a date column to see if the dates are the same, but only if a value in a one column first exists in another column.

 

All columns are on the same table.

 

Example

 

Step 1 - I want to see if the value in Parent Order# column exists in Order# column.

Step 2 - If it does I want to see if the Dates are the same.

Step 3 - Add a new column called match with Yes or No.

 

 

Order#Parent Order#DateMatch 
A12345 02/07/2025No
A12346A1234502/07/2025Yes
A12347B1234602/01/2025Yes
A12348 02/04/2025No
B12345A1234502/08/2025No
B12346 02/01/2025No
B12347 02/04/2025No
B12348A1234502/04/2025No
c12345 02/04/2025No
c12346 02/04/2025No
c12347B1234602/01/2025Yes
c12348 02/04/2025No
1 ACCEPTED SOLUTION
DataInsights
Super User
Super User

@gwoodley,

 

Try this calculated column:

 

Match = 
VAR vParentOrder = 'Table'[Parent Order#]
VAR vDate = 'Table'[Date]
VAR vTable =
    FILTER (
        'Table',
        'Table'[Order#] = vParentOrder
            && 'Table'[Date] = vDate
    )
VAR vResult =
    IF ( ISEMPTY ( vTable ), "No", "Yes" )
RETURN
    vResult

 

DataInsights_0-1739126638313.png

 





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




View solution in original post

2 REPLIES 2
DataInsights
Super User
Super User

@gwoodley,

 

Try this calculated column:

 

Match = 
VAR vParentOrder = 'Table'[Parent Order#]
VAR vDate = 'Table'[Date]
VAR vTable =
    FILTER (
        'Table',
        'Table'[Order#] = vParentOrder
            && 'Table'[Date] = vDate
    )
VAR vResult =
    IF ( ISEMPTY ( vTable ), "No", "Yes" )
RETURN
    vResult

 

DataInsights_0-1739126638313.png

 





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




Thank you 👍

Helpful resources

Announcements
July PBI25 Carousel

Power BI Monthly Update - July 2025

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

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 community update carousel

Fabric Community Update - June 2025

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