cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Hugo_RGS
Regular Visitor

Date Betwen

Hello guys,

Im trying to solve a problem i found while building my data model.
I got 2 differents tables :

- One with the account balance by month for each tenant.

Tenant AccountMonthAccount balance
48106-2022125 €
48107-2022422 €
48108-202223 €


- One with the litigation phase of the tenant, with the start date & the end date of the phase.

Tenant AccountLitigation phaseStart DateEnd Date
481Phase 113/05/202123/08/2021
481Phase 203/01/202224/07/2022
481Phase 106/08/202223/08/2022 

 

I have to associate the correct phase to each line in the first table. Any idea ? 

Thanks for reading 😄

1 ACCEPTED SOLUTION
amitchandak
Super User
Super User

@Hugo_RGS , Create a new column in table 1, convert account month into date or create a date from it

 

maxx(filter(Table2, Table2[tenant Account] = table1[tenant Account] && table1[Account Date]>= Table2[Start Date] && Table1[Account Date] <=  Table2[End date])  , Table2[Litigation phase])

View solution in original post

1 REPLY 1
amitchandak
Super User
Super User

@Hugo_RGS , Create a new column in table 1, convert account month into date or create a date from it

 

maxx(filter(Table2, Table2[tenant Account] = table1[tenant Account] && table1[Account Date]>= Table2[Start Date] && Table1[Account Date] <=  Table2[End date])  , Table2[Litigation phase])

Helpful resources

Announcements
PBI Sept Update Carousel

Power BI September 2023 Update

Take a look at the September 2023 Power BI update to learn more.

Learn Live

Learn Live: Event Series

Join Microsoft Reactor and learn from developers.

Top Solution Authors