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

Don't miss out! 2025 Microsoft Fabric Community Conference, March 31 - April 2, Las Vegas, Nevada. Use code MSCUST for a $150 discount. Prices go up February 11th. Register now.

Reply
romovaro
Responsive Resident
Responsive Resident

If several fields match, then provide Date

HI

 

I am having issues getting this right.

 

I have a table (table1) with columns

- CLient Name

- CID

- Country

- Go Live Date

 

And another table (table2) with the same columns

- Client Name

- CID

- COuntry

- Go Live Date (date format)

 

what I am trying to achieve is that

 

IF CID and Country is equal in both tables, then return the "Go Live date" from Table2

 

Thanks,

1 ACCEPTED SOLUTION
v-xuxinyi-msft
Community Support
Community Support

Hi @romovaro 

 

Thanks for the reply from ryan_mayu .

 

My sample:

 

Table1

vxuxinyimsft_4-1736920728027.png

 

Table2

vxuxinyimsft_5-1736920822661.png

 

You can also try to create a calculated column or measure using LOOKUPVALUE.

 

A calculated column:

Result = 
LOOKUPVALUE(
    Table2[Go Live Date (date format)],
    Table2[CID], Table1[CID],
    Table2[Country], Table1[Country]
)

 

Or a measure:

Result1 = 
LOOKUPVALUE(
    Table2[Go Live Date (date format)],
    Table2[CID], MAX(Table1[CID]),
    Table2[Country], MAX(Table1[Country])
)

 

Output:

vxuxinyimsft_3-1736920685421.png

 

Best Regards,
Yulia Xu

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

2 REPLIES 2
v-xuxinyi-msft
Community Support
Community Support

Hi @romovaro 

 

Thanks for the reply from ryan_mayu .

 

My sample:

 

Table1

vxuxinyimsft_4-1736920728027.png

 

Table2

vxuxinyimsft_5-1736920822661.png

 

You can also try to create a calculated column or measure using LOOKUPVALUE.

 

A calculated column:

Result = 
LOOKUPVALUE(
    Table2[Go Live Date (date format)],
    Table2[CID], Table1[CID],
    Table2[Country], Table1[Country]
)

 

Or a measure:

Result1 = 
LOOKUPVALUE(
    Table2[Go Live Date (date format)],
    Table2[CID], MAX(Table1[CID]),
    Table2[Country], MAX(Table1[Country])
)

 

Output:

vxuxinyimsft_3-1736920685421.png

 

Best Regards,
Yulia Xu

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

ryan_mayu
Super User
Super User

@romovaro 

you can merge tables in PQ

 

press ctrl and select CID and Country column, then you will see numbers beside the column. Do the same in the table2.

 

11.PNG22.PNG

 

or you can use DAX to get the date

 

Column = maxx(FILTER('Table (2)','Table'[CID]='Table (2)'[CID]&&'Table'[Country]='Table (2)'[Country]),'Table (2)'[golivedate])
12.PNG
 

 





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

Proud to be a Super User!




Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Prices go up Feb. 11th.

Jan25PBI_Carousel

Power BI Monthly Update - January 2025

Check out the January 2025 Power BI update to learn about new features in Reporting, Modeling, and Data Connectivity.

Jan NL Carousel

Fabric Community Update - January 2025

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