Forum Discussion
Dax Table Filterting
Attached some sample data:
I have Table 1 and Table 2. What I would like to do is in Table 1 attach a new column with the giveName column from Table 2. The tricky part is that the records need to match on these criteria:
PostedDate of Table 1 is less or equal from the date columns in Table 2 that have the "Start" prefix
and
PostedDate of table 1 is greater or equal from the "Thru" date columns or the "Thru" columns are null.
If there are more that 1 records that match, I'd like to concatane the names by a comma if possible.
Table 1:
https://www.dropbox.com/s/qx8vvofcwqle5uq/table1.xlsx?dl=0
Table 2:
https://www.dropbox.com/s/pshwj3a3j4qdwst/table2.xlsx?dl=0
Hi,
Could you kindly show the expected result in a few rows of column H of the table1.xlsx file?
- jeronimo23345 years agoHelper III
Hi, I forgot to include something important in tables 1 & 2, the ID column. Table 1 and Table 2 should match on the ID column.
I added Table 3 which is what the expected result should be.
https://www.dropbox.com/sh/lgdxefabz139xsh/AADnr0RfSe-4YTWMs9Xjj34Ga?dl=0
Just for reference, if this was to be done via MySQL, the 'where' parameters would look like this
set @d = "2018-01-12";#example of posted
...WHERE cr.effectiveDateStart <= @d and (cr.effectiveDateThru is null or cr.effectiveDateThru >= @d) and c_r.effectiveDateStart <= @d and (c_r.effectiveDateThru is null or c_r.effectiveDateThru >= @d) and opi.effectiveDateStart <= @d and (opi.effectiveDateThru is null or opi.effectiveDateThru >= @d) and pi.effectiveDateStart <= @d and (pi.effectiveDateThru is null or pi.effectiveDateThru >= @d) and ui.effectiveDateStart <= @d and (ui.effectiveDateThru is null or ui.effectiveDateThru >= @d)