Forum Discussion
Check if some ids are inside a campaign
- 4 years ago
Hi IliasKatsis
Thanks for your screenshots.
The known conditions are,
1. You want to get the description from the campaigns table and put it into the Transcation table,
2. Use the date of the Transcation table to filter the campaigns table,
3. Use the coupon_id of the Transcation table to filter the Campaign details, and then you want to filter the campaigns table by this
one idea isCurrent Camp = var _t1=SELECTCOLUMNS(FILTER(ALL('Campaign details'),'Campaign details'[Coupon ID]= MIN(Transactions[coupon_id])),"s",[Campaign ID]) return MAXX ( FILTER ( Campaigns, Campaigns[StartDate]<=MIN(Transactions[Transaction Date] ) && Campaigns[EndDate]>=MIN(Transactions[Transaction Date])&& Campaigns[Campaign ID] in _t1 ), Campaigns[Description] )result (based on my sample)
Best Regards,
Community Support Team _Tang
If this post helps, please consider Accept it as the solution to help the other members find it more quickly.
Hi IliasKatsis
Thanks for reaching out to us.
>> I want to check if some coupon ids from transactions table are included in some campaigns from the campaign details table.
what's your expected output? if some coupon ids from transactions table are included in some campaigns from the campaign details table, then measure returns (?)
and could you please share some sample data to help us find the solution faster? thanks.
Best Regards,
Community Support Team _Tang
If this post helps, please consider Accept it as the solution to help the other members find it more quickly.
- IliasKatsis4 years ago
Helper I
what's your expected output? if some coupon ids from transactions table are included in some campaigns from the campaign details table, then measure returns (?) Then it returns the name of the current campaign.. sorry for any inconvenience.
The sample data is this : Transcation table
and Campaign details
and campaigns table
i tried this :
Current Camp = maxx(filter(Campaigns, Transactions[Transaction Date] >= Campaigns[StartDate] && Transactions[Transaction Date]<= Campaigns[EndDate] && Transactions[coupon_id] in VALUES('Campaign details'[Coupon ID])), Campaigns[Description]) but it did not work.Thanks for your help- v-xiaotang4 years ago
Community Support
Hi IliasKatsis
Thanks for your screenshots.
The known conditions are,
1. You want to get the description from the campaigns table and put it into the Transcation table,
2. Use the date of the Transcation table to filter the campaigns table,
3. Use the coupon_id of the Transcation table to filter the Campaign details, and then you want to filter the campaigns table by this
one idea isCurrent Camp = var _t1=SELECTCOLUMNS(FILTER(ALL('Campaign details'),'Campaign details'[Coupon ID]= MIN(Transactions[coupon_id])),"s",[Campaign ID]) return MAXX ( FILTER ( Campaigns, Campaigns[StartDate]<=MIN(Transactions[Transaction Date] ) && Campaigns[EndDate]>=MIN(Transactions[Transaction Date])&& Campaigns[Campaign ID] in _t1 ), Campaigns[Description] )result (based on my sample)
Best Regards,
Community Support Team _Tang
If this post helps, please consider Accept it as the solution to help the other members find it more quickly.