Forum Discussion
compare 2 dates from different tables
Hello, I would really appreciate the help.
I have 2 tables with custom columns
I need to compare those 2 dates and get the difference in months and that I stay in Table 1 I do not know if as a column or as a measure, because then I need to calculate which ones have more than 6 months for the fulfillment of an indicator. For example:
Hi Syndicate_Admin ,
Try to create a new column like below:Column = var date_ = LOOKUPVALUE('Table 2'[FechaRegistro],'Table 2'[ID],'Table 1'[ID]) return DATEDIFF(date_,'Table 1'[Fechasolucion],MONTH)If you want to save the dates in Table 2 in Table 1, create this column:
Column 2 = LOOKUPVALUE('Table 2'[FechaRegistro],'Table 2'[ID],'Table 1'[ID])
Best Regards,
Liang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
2 Replies
- amitchandakSuper User
we can get a new column in table 1 the date of table 2 based on ID
Date table 2 = maxx(filter(Table2, Table2[ID] = Table1[ID]), Table2[Date])
Usually, we create a common date table and join it with date of both tables and use that
- V-lianl-msftCommunity Support
Hi Syndicate_Admin ,
Try to create a new column like below:Column = var date_ = LOOKUPVALUE('Table 2'[FechaRegistro],'Table 2'[ID],'Table 1'[ID]) return DATEDIFF(date_,'Table 1'[Fechasolucion],MONTH)If you want to save the dates in Table 2 in Table 1, create this column:
Column 2 = LOOKUPVALUE('Table 2'[FechaRegistro],'Table 2'[ID],'Table 1'[ID])
Best Regards,
Liang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.