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

Level up your Power BI skills this month - build one visual each week and tell better stories with data! Get started

Reply
Anonymous
Not applicable

Calculated Table

Hi, We have 2 tables and the requirement is we have to compare date from table 2 with date from table 1 and provide output as calculated table.  Thank you in advance.

 

Table 1 -

countryratedate
MX.503/10/2020
MX.803/11/2020
US.703/10/2020
US.903/11/2020
MX.803/20/2020
US.703/20/2020

 

Table 2

 

Date
03/11/2020

 

Result Table -

 

countryratedate
US.903/11/2020
MX.803/11/2020

 

2 REPLIES 2
technolog
Super User
Super User

Option A. Filter with IN

Result =
FILTER(
Table1,
Table1[date] IN VALUES(Table2[Date])
)

This semijoins Table1 by the distinct dates in Table2. Works even if Table2 has many dates. No relationship needed.

Option B. Natural inner join by aligning column names

Result =
NATURALINNERJOIN(
Table1,
DISTINCT(
SELECTCOLUMNS(Table2, "date", Table2[Date])
)
)

SELECTCOLUMNS gives Table2 a column named date so the natural join can match it to Table1[date]. DISTINCT avoids duplicates from repeated dates in Table2.

Option C. Use TREATAS inside CALCULATETABLE

Result =
CALCULATETABLE(
Table1,
TREATAS(VALUES(Table2[Date]), Table1[date])
)

TREATAS applies the Table2 dates as a filter over Table1. It is very readable in larger models.

 

Anonymous
Not applicable

NaturalinnerJoin on date column will work for you.

 

Or you can simply create one column in first table.

 

Column=Lookupvalue(table2[date],table2[Date],table1[date])

 

Filter out this column to is not blank.

 

Thanks & regards,
Pravin Wattamwar
www.linkedin.com/in/pravin-p-wattamwar

If I resolve your problem Mark it as a solution and give kudos.

 

 

 

Helpful resources

Announcements
April Power BI Update Carousel

Power BI Monthly Update - April 2026

Check out the April 2026 Power BI update to learn about new features.

Fabric SQL PBI Data Days

Data Days 2026 coming soon!

Sign up to receive a private message when registration opens and key events begin.

New to Fabric survey Carousel

New to Fabric Survey

If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.