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.
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] )
)
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
114 | |
100 | |
81 | |
70 | |
62 |
User | Count |
---|---|
148 | |
116 | |
104 | |
90 | |
65 |