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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
vojtechsima
Memorable Member
Memorable Member

Determine a Column based on a different column based on date interval

Hello,

I have these tables (Name = Subscription Name):

vojtechsima_2-1619177355243.png

vojtechsima_5-1619177423527.png

I would like to determine the Entity of each record (in the first Table, taken from the Second Table), However, the Name can have two or more Entities, which means I have to evaluate when the record belongs to which Entity based on the FROM/TILL Columns.  So Basically I want to display a New column in the First Table that will show the proper entity for the Date.

Can you help me with this?

 

 

1 ACCEPTED SOLUTION
amitchandak
Super User
Super User

@vojtechsima , a new column in table 1

 

maxx(filter(Table2, Table1[Name] = Table2[Subscription Name] && Table1[Date] >= Table2[from] && (Table1[Date] <= Table2[to] || isblank(Table2[to]))), Table2[Entity])

 

 

View solution in original post

2 REPLIES 2
amitchandak
Super User
Super User

@vojtechsima , a new column in table 1

 

maxx(filter(Table2, Table1[Name] = Table2[Subscription Name] && Table1[Date] >= Table2[from] && (Table1[Date] <= Table2[to] || isblank(Table2[to]))), Table2[Entity])

 

 

@amitchandak Thank you very much! This did the trick.

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

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

April Fabric Community Update

Fabric Community Update - April 2024

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