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.
Anonymous
5 years agoNot applicable
HI DJ1977,
It sounds like a common issue when you use the 'math' operators to compare with different types of values. Please check your two table date fields to confirm if they are correctly formatted as date types.
Regards,
Xiaoxin Sheng
DJ1977
Helper I
5 years agoHi Anonymous and thank you very much for your answer. This fixed the error and now i have a solution to my problem, with help of your tip and Ashish_Mathur DAX formula above.
Regards
DJ
- Ashish_Mathur5 years ago
Super User
You are welcome.
- Anonymous5 years agoNot applicable