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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now

Reply
gigotomo
Frequent Visitor

Lookup for dates

I have 2 tables , Table1and Table2.

I require to check whether Table2[Date] exists in Table1 and in case it does then Table2[type] should be Red or else Green.

Capture.JPGCapture1.JPG

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

Hi, @gigotomo 

According to your requirement, I think you can achieve this using DAX to create a calculated column in the Table 2 like this:

Type =

IF(

    [Date] in SELECTCOLUMNS('Table 1',"1",[Date]),

    "Red","Green")

 

And you can get what you want, like this:

v-robertq-msft_0-1617615626532.png

 

You can download my test pbix file here

More info about SelectColumns() function in DAX

 

Best Regards,

Community Support Team _Robert Qin

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

3 REPLIES 3
v-robertq-msft
Community Support
Community Support

Hi, @gigotomo 

According to your requirement, I think you can achieve this using DAX to create a calculated column in the Table 2 like this:

Type =

IF(

    [Date] in SELECTCOLUMNS('Table 1',"1",[Date]),

    "Red","Green")

 

And you can get what you want, like this:

v-robertq-msft_0-1617615626532.png

 

You can download my test pbix file here

More info about SelectColumns() function in DAX

 

Best Regards,

Community Support Team _Robert Qin

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

PC2790
Community Champion
Community Champion

Hello @gigotomo ,

 

Create a new column with the following DAX:

Flag = If(NOT(ISBLANK(LOOKUPVALUE(Table1[Date],Table1[Date],Table2[Date]))),"Red","Green")
amitchandak
Super User
Super User

@gigotomo ,


New column in Table 2 =
var _1 = countx(filter(Table1,Table1[Date] =Table2[Date]), Table1[Date])
return
if(isblank(_1), false(), true())

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

Helpful resources

Announcements
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!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

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

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.

Top Solution Authors