Forum Discussion
ravi_609
Helper I
2 years agoHow to calculate conditional customer distinct count?
Hello Friends, I have attached data table below: I need distinct count of CustomerID for "V1-V2" Common Vertical. Note: If any customer have only "V1" Vertical and "V1-V2-V3" then it ...
Anonymous
2 years agoNot applicable
UniqueIDCount =
COUNTROWS(
FILTER(
SUMMARIZE(
YourTable,
YourTable[ID],
"Verticals", CONCATENATEX(VALUES(YourTable[vertical]), YourTable[vertical], ",")
),
(CONTAINSSTRING([Verticals], "V1") && CONTAINSSTRING([Verticals], "V2"))
&& NOT CONTAINSSTRING([Verticals], "V3")
)
)
not the most eloquent solution, but this should work
ravi_609
Helper I
2 years agoAnonymous Thanks for the response but This measure is not working...!!!
I got solution with SQL Server Query:
SELECT CustomerID,COUNT(Verical)
FROM Vertical
GROUP BY CustomerID
HAVING CustomerID not in (Select CustomerID From Vertical where Verical not in ('V1','V2')) and COUNT(Verical) = 2
But I am stuck here that how to use this same logic into measure.