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
newgirl
Post Patron
Post Patron

Lookup using Start Date

Hello! I have my main table below:

Main Table

Transaction DateVolumeClientProduct
1-Jan-2210Aballpen
1-Jan-2220Bnotebook
10-Jan-2230Bballpen
28-Feb-2240Aballpen
31-Mar-2210Cballpen

 

I need to add a new column for the category of the product based on the transaction date. However, the categorization changes over time. I have this table to capture that information:

Supporting Table

Start DateEnd DateProductCategory
1-Jan-2231-Jan-22ballpenOffice
1-Jan-2231-Jan-22notebookOffice
1-Jan-2231-Jan-22mugPersonal
1-Jan-2231-Jan-22pencilOffice
1-Feb-2231-Dec-22ballpenPersonal
1-Feb-2231-Dec-22notebookOffice
1-Feb-2231-Dec-22mugPersonal
1-Feb-2231-Dec-22pencilOffice

 

 

Here is my expected output:

Transaction DateVolumeClientProductCategory
1-Jan-2210AballpenOffice
1-Jan-2220BnotebookOffice
10-Jan-2230BballpenOffice
28-Feb-2240AballpenPersonal
31-Mar-2210CballpenPersonal

 

I tried the formula below (after I read some of the questions in this forum) but it says "A table of multiple values was supplied where a single value was expected."

 

Column = CALCULATE(VALUES('Supporting'[Category]),FILTER('Supporting','Main Table'[Transaction Date]>='Supporting'[Start Date] && 'Main Table'[Transaction Date] <= 'Supporting'[End Date]))

 

 

 

Hope somebody can help me!

1 ACCEPTED SOLUTION
ryan_mayu
Super User
Super User

@newgirl 

pls try this

Column = maxx(FILTER('Supporting Table','Main Table'[Transaction Date]>='Supporting Table'[Start Date]&&'Main Table'[Transaction Date]<='Supporting Table'[End Date]&&'Main Table'[Product]='Supporting Table'[Product]),'Supporting Table'[Category])

2.PNG





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

Proud to be a Super User!




View solution in original post

3 REPLIES 3
ryan_mayu
Super User
Super User

@newgirl 

pls try this

Column = maxx(FILTER('Supporting Table','Main Table'[Transaction Date]>='Supporting Table'[Start Date]&&'Main Table'[Transaction Date]<='Supporting Table'[End Date]&&'Main Table'[Product]='Supporting Table'[Product]),'Supporting Table'[Category])

2.PNG





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

Proud to be a Super User!




Thank you so much!! This worked!

you are welcome





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.

Feb2025 Sticker Challenge

Join our Community Sticker Challenge 2025

If you love stickers, then you will definitely want to check out our Community Sticker Challenge!

Jan NL Carousel

Fabric Community Update - January 2025

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