Forum Discussion
Date column filter another table
davi_luc , we can copy the date from table to table to and take a diff and then use as diff
a new measure
Countx(Table2 ,
var _col = maxx(filter(Table1, Table1[ID] = Table2[ID]), Table1[Date])
var _diff = abs(datediff(Table2[Date], Table1[Date], Day) )
return
if(_diff <=5, Table2[ID], blank())
in case you want create a column
new column =
var _col =maxx(filter(Table1, Table1[ID] = Table2[ID]), Table1[Date])
return abs(datediff(Table2[Date], Table1[Date], Day) )
Hello amitchandak , thanks for your response.
If I understood correctly, your answer won't work for me.
In the example, if we look at Table A, ID = 1, we have two different dates, 15/01/2022 and 10/01/2022. The "allowed" dates, for ID = 1, in Table B, should be 5,6,7,8,9,10,11,12,13,14,15 of january.
Your solution, since it uses a MAXX, would only allow the dates 10,11,12,13,14,15 of january.