Forum Discussion
DJ1977
Helper I
5 years agoAdd column for campaign within daterange
Hello. I have a small case here that I can not find a solution to by searching the forum here. Hope someone can give me a tip. I have a model with two tables, A & B, among several. ...
- 5 years ago
Hi,
This calculated column formula works
=CALCULATE(VALUES(Table1[Campaign]),FILTER(Table1,Table1[Customer]=EARLIER(Table2[Customer])&&Table1[Product ID]=EARLIER(Table2[Product ID])&&Table1[Start date]<=EARLIER(Table2[Salesdate])&&Table1[End date]>=EARLIER(Table2[Salesdate])))Hope this helps.
amitchandak
Super User
5 years agoDJ1977 , Try this formula. As a new Dax column
minx(filter(TableA, TableA[StartDate] <=Tableb[SalesDate] && TableA[endDate] >=Tableb[SalesDate] && && TableA[productID] >=Tableb[productID]), TableA[]campaign])
Refer this video , how copy value from one table to another :https://www.youtube.com/watch?v=czNHt7UXIe8