Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and a 50 percent discount on exams.
Get startedEarn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.
Hi all,
I have 3 tables
I have a slicer that's using 'CALENDAR LOOKUP'[Date]
I am trying to get the COUNT of the OPPORTUNITY_ID with the below crietera:
- SUBMITTED_DATE in the last 30 days
- OPPORTUNITY_INFO[CONVERTED_FROM_LEAD] = "Yes"
- CAMPAIGN_LOOKUP[CAMPAIGN_TYPE] IN {"Email", "Lead Generation", "Paid Search", "Seminar / Conference", "Website"}
Below is the DAX code that I have at the moment, it's not giving me the correct result. (now it's giving me 141, but it should be more than 200). I am not sure how to correctly use USERELATIONSHIP + FILTER(), could anyone please let me know where I did wrong in my DAX code?
test =
CALCULATE(
DISTINCTCOUNT(OPPORTUNITY_INFO[OPPORTUNITY_ID]),
USERELATIONSHIP(OPPORTUNITY_INFO[SUBMITTED_DATE], 'CALENDAR LOOKUP'[Date]),
FILTER(
OPPORTUNITY_INFO,
OPPORTUNITY_INFO[CONVERTED_FROM_LEAD] = "Yes" &&
RELATED(CAMPAIGN_LOOKUP[CAMPAIGN_TYPE]) IN {"Email", "Lead Generation", "Paid Search", "Seminar / Conference", "Website"}
)
)
Solved! Go to Solution.
I'm pretty sure the issue is that USERELATIONSHIP is not being applied to OPPORTUNITY_INFO inside the FILTER. There are ways to fix that but I think you might be able to bypass that problem entirely by changing your filter conditions.
Try this:
CALCULATE (
DISTINCTCOUNT ( OPPORTUNITY_INFO[OPPORTUNITY_ID] ),
OPPORTUNITY_INFO[CONVERTED_FROM_LEAD] = "Yes",
CAMPAIGN_LOOKUP[CAMPAIGN_TYPE]
IN { "Email", "Lead Generation", "Paid Search", "Seminar / Conference", "Website" },
USERELATIONSHIP ( OPPORTUNITY_INFO[SUBMITTED_DATE], 'CALENDAR LOOKUP'[Date] )
)
I'm pretty sure the issue is that USERELATIONSHIP is not being applied to OPPORTUNITY_INFO inside the FILTER. There are ways to fix that but I think you might be able to bypass that problem entirely by changing your filter conditions.
Try this:
CALCULATE (
DISTINCTCOUNT ( OPPORTUNITY_INFO[OPPORTUNITY_ID] ),
OPPORTUNITY_INFO[CONVERTED_FROM_LEAD] = "Yes",
CAMPAIGN_LOOKUP[CAMPAIGN_TYPE]
IN { "Email", "Lead Generation", "Paid Search", "Seminar / Conference", "Website" },
USERELATIONSHIP ( OPPORTUNITY_INFO[SUBMITTED_DATE], 'CALENDAR LOOKUP'[Date] )
)
User | Count |
---|---|
90 | |
74 | |
67 | |
63 | |
55 |
User | Count |
---|---|
99 | |
88 | |
72 | |
60 | |
59 |