The ultimate Fabric, Power BI, SQL, and AI community-led learning event. Save €200 with code FABCOMM.
Get registeredEnhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.
Hi Guys,
Hope you can help with some Dax fun.
I need a measure to calculate how many unique customers that have bougt only through agencies in 2021.
The output that I seek is from this Data is = 3.
(Only customer D,E & F have bought through Agency only in 2021)
I have tried this, but it dosn't give me the result I want.
My Data looks like:
Year | Month | Customer | Revenue | Channel |
2021 | Jan | A | 100 | Agency |
2021 | Jan | B | 150 | Agency |
2021 | Jan | C | 100 | Agency |
2021 | Jan | D | 120 | Agency |
2021 | Jan | E | 80 | Agency |
2021 | Jan | F | 90 | Agency |
2021 | Jan | F | 20 | Agency |
2021 | Feb | A | 120 | Direct |
2021 | Feb | B | 90 | Direct |
2021 | Feb | C | 100 | Direct |
Solved! Go to Solution.
@Anonymous Perhaps:
Measure =
VAR __Direct = SUMMARIZE(FILTER('Table',[Year]=2021 && [Channel]="Direct"),[Customer])
VAR __Agency = SUMMARIZE(FILTER('Table',[Year]=2021 && [Channel]="Agency"),[Customer])
RETURN
COUNTROWS(
EXCEPT(
__Agency,
__Direct
)
)
Works like a charm - thanks!
@Anonymous Perhaps:
Measure =
VAR __Direct = SUMMARIZE(FILTER('Table',[Year]=2021 && [Channel]="Direct"),[Customer])
VAR __Agency = SUMMARIZE(FILTER('Table',[Year]=2021 && [Channel]="Agency"),[Customer])
RETURN
COUNTROWS(
EXCEPT(
__Agency,
__Direct
)
)
User | Count |
---|---|
25 | |
12 | |
8 | |
8 | |
7 |
User | Count |
---|---|
27 | |
12 | |
12 | |
12 | |
6 |