Forum Discussion
StephenClarke
3 years agoFrequent Visitor
Range Lookup for Marketing Attribution
Dear Community Forum, I would like to run a formula that assigns a last touch attribtion logic of marketing activity to my orders. I have: an Order table showing which cleints ordered when ...
- 3 years ago
Try this calculated column in the Orders table. There is no relationship between these tables in this example.
Marketing Activity = VAR vTransactionDate = Orders[Transaction Date] VAR vClient = Orders[Client] VAR vMarketingTable = FILTER ( Marketing, Marketing[Client] = vClient && Marketing[Date of Marketing Activity] < vTransactionDate && Marketing[Date of Marketing Activity] >= vTransactionDate - 90 ) VAR vMaxDateMarketingActivity = MAXX ( vMarketingTable, Marketing[Date of Marketing Activity] ) VAR vResult = MAXX ( FILTER ( vMarketingTable, Marketing[Date of Marketing Activity] = vMaxDateMarketingActivity ), Marketing[Marketing Activity] ) RETURN IF ( ISBLANK ( vResult ), "NA", vResult )
DataInsights
Super User
3 years ago
Try this calculated column in the Orders table. There is no relationship between these tables in this example.
Marketing Activity =
VAR vTransactionDate = Orders[Transaction Date]
VAR vClient = Orders[Client]
VAR vMarketingTable =
FILTER (
Marketing,
Marketing[Client] = vClient
&& Marketing[Date of Marketing Activity] < vTransactionDate
&& Marketing[Date of Marketing Activity] >= vTransactionDate - 90
)
VAR vMaxDateMarketingActivity =
MAXX ( vMarketingTable, Marketing[Date of Marketing Activity] )
VAR vResult =
MAXX (
FILTER (
vMarketingTable,
Marketing[Date of Marketing Activity] = vMaxDateMarketingActivity
),
Marketing[Marketing Activity]
)
RETURN
IF ( ISBLANK ( vResult ), "NA", vResult )