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
TerenceM
Frequent Visitor

How can I determine whether an order is placed by VIP with VIP history table

Hello, 

I have done my research but couldn't find any similar cases.

 

My problem is

 

I have two tables, one is the sales table

Order idCustomer IDOrder DateSales Region
1123456782020-11-22HK
2234567892020-12-23US

 

Another one is the VIP History Table

Customer IDVIP Start DateVIP End DateType of VIP
123456782019-01-012020-01-01VIP
123456782021-01-012022-01-01VIP
234567892020-02-012021-02-01VVIP

 

What I want to do is to determine whether the order is purchased within the VIP period

So for the first order, it's not a VIP order, because the order date does not fall in the neither VIP period of the customer 12345678

On the other hand, the second order is a VVIP order, because the order date fall into the VVIP period of the customer 23456789.

 

Thank you in advance!

 

Best Regards,

Terence

1 ACCEPTED SOLUTION
amitchandak
Super User
Super User

@TerenceM , You can get that value in first table and then check for it

 

a new column in the first table =

maxx(filter(VIP, VIP{Customer ID] = Sales[Customer ID] && Sales[Order Date] >= VIP[Start Date] && Sales[Order Date]<= VIP[End Date]) , VIP[TYPE of VIP] )

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

View solution in original post

2 REPLIES 2
TerenceM
Frequent Visitor

Thank you very much for your prompt reply! It works!

amitchandak
Super User
Super User

@TerenceM , You can get that value in first table and then check for it

 

a new column in the first table =

maxx(filter(VIP, VIP{Customer ID] = Sales[Customer ID] && Sales[Order Date] >= VIP[Start Date] && Sales[Order Date]<= VIP[End Date]) , VIP[TYPE of VIP] )

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
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.

Top Solution Authors
Top Kudoed Authors