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

View all the Fabric Data Days sessions on demand. View schedule

Reply
vennajx
New Member

To add new column, by comparing date fields from 2 tables

Hello,

I have just started with Power BI, I'm not sure if this is a lame question to ask.

 

I have start_date in Table A and Approval_date in Table B.I want to compare these 2 date columns and create a new column say 'Flag'.If start _date is greater than approval_date then'1' else'0'.  I don't have direct relationship between the tables


@Greg_Deckler

1 ACCEPTED SOLUTION

Hi  @vennajx ,

 

If there is a primary key,you could use below method:

Create a column as below:

approval date = LOOKUPVALUE('Table B'[Approval_date],'Table B'[Index],'Table'[Index],blank())

And you will see:

vkellymsft_0-1631868812941.png

Then you create another column to compare the two dates.

For the related .pbix file,pls see attached.

 

Best Regards,
Kelly

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

View solution in original post

3 REPLIES 3
Anonymous
Not applicable

No relationship--that's pretty tough to work with, but if you know that the dates between tables are on the same row, then you could try add a step like:

= List.Zip({#"Table A"[Start_Date], #"Table_B"[End_Date]})

 

Then you can extract the list values (as opposed to expanding to new rows) and do the row by row math.

 

--Nate

@Anonymous I will try to get the relationship from the source team.Lets think we have key(PK) how can we compare.

Hi  @vennajx ,

 

If there is a primary key,you could use below method:

Create a column as below:

approval date = LOOKUPVALUE('Table B'[Approval_date],'Table B'[Index],'Table'[Index],blank())

And you will see:

vkellymsft_0-1631868812941.png

Then you create another column to compare the two dates.

For the related .pbix file,pls see attached.

 

Best Regards,
Kelly

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

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.