Don't miss your chance to take the Fabric Data Engineer (DP-700) exam on us!
Learn moreNext up in the FabCon + SQLCon recap series: The roadmap for Microsoft SQL and Maximizing Developer experiences in Fabric. All sessions are available on-demand after the live show. Register now
Hey all!
Firstly, a sample of my 2 tables.
Table1: Project
CustomerID | ProjectID | ProjectDateCreated
1 5 2020-13-05
2 5 2020-13-05
3 5 2021-01-01
Table2: Activities
CustomerID | ActivityType | ActivityDate
1 Call 2020-21-05
1 Visit 2020-05-05
2 Mail 2020-03-01
2 Call 2021-10-01
3 Visit 2020-08-10
What I want to do is to: Check all the activities that have taken place, after a Project was planned on that customer. So in this example activities in red should be filtered, because the ActivityDate < ProjectDateCreated on CustomerID. It doesn't matter if the Project isn't related to the Activity.
I've tried the following calculated column, to filter out the activities:
Solved! Go to Solution.
@Anonymous , create a new column like
Relevance=
var _1 = Countx(FILTER(Projects, Projects[CustomerID] = Activities[CustomerID] && Activities[ActivityDate] >= Project[ProjectDateCreated]),Projects[CustomerID])
return
if(isblank(_1),0,1)
Hi @Anonymous ,
Try this measure
Relevance =
IF (
CALCULATE (
MAX ( 'Activities'[ActivityDate] ),
ALLEXCEPT ( Activities, Activities[CustomerID] )
)
< CALCULATE (
MAX ( 'Project'[ProjectDateCreated] ),
ALLEXCEPT ( 'Project', Project[CustomerID] )
),
1,
0
)
Best Regards,
Stephen Tao
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
@Anonymous , create a new column like
Relevance=
var _1 = Countx(FILTER(Projects, Projects[CustomerID] = Activities[CustomerID] && Activities[ActivityDate] >= Project[ProjectDateCreated]),Projects[CustomerID])
return
if(isblank(_1),0,1)
Maybe yet another question regarding your answer.
Let's say the Activity can be longer than 30 days away from ProjectDateCreated and should also look 7 days in the past. How would I add that logic?
I've tested "+30" on numerous spots, but I am not sure.
So activities 7 days in the past, prior to the creation of the event and no more than 30 days after the creation of the event. I'd love to hear it :)!
Would je be willing to tell me?
If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.
A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.
Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.
| User | Count |
|---|---|
| 56 | |
| 47 | |
| 44 | |
| 20 | |
| 20 |
| User | Count |
|---|---|
| 73 | |
| 72 | |
| 34 | |
| 33 | |
| 31 |