Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
Anonymous
Not applicable

Date range- Filter if match

I have two tables.

 

Table 1: 

 

Phone---------------Campaign------------Effective----------Term
8005040001---------Unsued--------------1/1/2020---------3/15/2021
8005040001---------AWS-----------------3/16/2021
8005040002---------Microsoft------------1/1/2020
8005040003---------Amazon-------------1/1/2020---------7/31/2021
8005040004---------CDW-----------------8/1/2021
8005040005---------Unsued--------------1/1/2020---------9/30/2021
8005040005---------Dell------------------10/1/2021
8005040006---------HP-------------------1/1/2020---------4/30/2021
8005040007---------DataVox-------------5/1/2021
8005040008---------Unsued--------------1/1/2020--------12/31/2020
8005040008---------Website--------------1/1/2021--------3/14/2021
8005040008---------Cheveron------------3/15/2021
8005040009---------Symantec------------1/1/2020---------3/15/2021


This is a log of when a toll free number was assigned to a particular campaign. If Term date is blank, then it means it is still activly assigned to that particular campaign.

 

Table 2:

 

Call ID----------Timestamp------------------Camp_Ph
101370---------1 Oct 2020 17:30:37-------8005040001
101371---------1 Oct 2021 18:20:36-------8005040001
101372---------1 Sep 2020 18:22:35-------8005040005
101373---------2 Oct 2021 19:16:32-------8005040005
101374--------31 Dec 2020 08:41:54------8005040008
101375--------3 Feb 2021 09:39:17-------8005040008
101376--------3 Oct 2021 09:39:17-------8005040008
101377--------3 Oct 2021 09:39:17-------8005040002


Is a call log of when calls came in and what number was used by the caller.

 

Final Result should be 

 

Call ID------ Timestamp-------------------Camp_Ph--------------Campaign
101370-----1 Oct 2020 17:30:37-----------8005040001----------Unsued
101371-----1 Oct 2021 18:20:36-----------8005040001----------AWS
101372-----1 Sep 2020 18:22:35-----------8005040005----------Unsued
101373-----2 Oct 2021 19:16:32-----------8005040005----------Dell
101374-----31 Dec 2020 08:41:54---------8005040008----------Unsued
101375-----3 Feb 2021 09:39:17----------8005040008-----------Website
101375-----3 Oct 2021 09:39:17-----------8005040008----------Cheveron
101375-----3 Oct 2021 09:39:17-----------8005040002----------Microsoft


There are two checks that need to happen.

 

1. Find the toll free number in the Campaing table against teh call log entry.

2. Find the Campaign assigned based on (Call Log [timestamp]) against the Effective and Term date of the Campaign.

 

 

Thank you in advance for your help

1 ACCEPTED SOLUTION
ryan_mayu
Super User
Super User

@Anonymous 

you can try this

Column = maxx(FILTER(Table1,Table1[Phone]=Table2[Camp_Ph]&&Table1[Effective]<=Table2[Timestamp]&&(Table1[Term]+1>Table2[Timestamp]||ISBLANK(Table1[Term]))),Table1[Campaign])

1.PNG

pls see the attachment below





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




View solution in original post

2 REPLIES 2
ryan_mayu
Super User
Super User

@Anonymous 

you can try this

Column = maxx(FILTER(Table1,Table1[Phone]=Table2[Camp_Ph]&&Table1[Effective]<=Table2[Timestamp]&&(Table1[Term]+1>Table2[Timestamp]||ISBLANK(Table1[Term]))),Table1[Campaign])

1.PNG

pls see the attachment below





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




Anonymous
Not applicable

Sorry my post got stuck in the spam, bumping it back for solution. Thank you

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.