The ultimate Fabric, Power BI, SQL, and AI community-led learning event. Save €200 with code FABCOMM.
Get registeredCompete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.
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 |
---|---|
28 | |
10 | |
8 | |
6 | |
5 |
User | Count |
---|---|
34 | |
13 | |
12 | |
9 | |
7 |