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 two queries joined by a key. The two queries are Customer details & Responses. I want to get a count of how many unique customers that have responses. A customer can have more than one response but i just want to count that customer once.
I want to do something like this:
DISTINCTCOUNT (CustomerName) WHERE 'CustomerDetails'[Key] = 'Responses'[Key]
Any help would be great
Thanks
B
Solved! Go to Solution.
Can you have a try
No of Customers have at least one response = COUNTROWS ( FILTER ( Customers, IF ( ISBLANK ( LOOKUPVALUE ( Response[CustomerID], Customers[CustomerID], Customers[CustomerID] ) ), 0, 1 ) ) )
Say the two tables are as below and a proper relationship is created. Check a measure like
No of Customers have at least one response = COUNTROWS(FILTER(Customers,LOOKUPVALUE(Response[CustomerID],Customers[CustomerID],Customers[CustomerID])))
Hi @Eric_Zhang
Thanks for the reply. My key is an alphamumeric key and as such the LOOKUPVALUE command will not work. It will work perfectly if my key was an integer. I may be able to do some transformation on the column to solve this if there is no other way.
Do you know of any workaround for alphanumeric values?
Thanks
Brian
Can you have a try
No of Customers have at least one response = COUNTROWS ( FILTER ( Customers, IF ( ISBLANK ( LOOKUPVALUE ( Response[CustomerID], Customers[CustomerID], Customers[CustomerID] ) ), 0, 1 ) ) )
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 |
---|---|
109 | |
99 | |
77 | |
66 | |
54 |
User | Count |
---|---|
144 | |
104 | |
102 | |
87 | |
64 |