Forum Discussion
distinct count total
Hi community,
I would like to get an overview of the amount of distinct customers who buy a specific product within a specific period.
The specific product and specific period are selected by a filter, which is ideally dynamic for the end user.
The table below has been used to generate the overview in the second screenshot.
The problem here is that the overview seems to count all the customers and not only the customer who bought the specific product. As a result, the total row amount is way too high and constant over time.
When removing the customer name I get this:
I would like to get the sum of the visible values as a row total. In the last column of screenshot 2 that would mean 6.
I have looked at other forum posts, but could not find a solution there.
How can I solve this? Can someone please help to steer me towards a solution?
Thanks
- Anonymous6 years ago
With the formula described by OwenAuger ( https://community.powerbi.com/t5/Desktop/How-to-count-unique-values-based-on-aggregated-sums/m-p/153940#M66617 ), I managed to get the desired result!
11 Replies
- parry2kSuper User
Anonymous are you using the measure to show the count? If yes what is the measure expression?
- AnonymousNot applicable
I do not think that it is a measure that I used. Should I do that? If so, how should it look like?
I tried:Distinct count customer = DISTINCTCOUNT('Dim Customer'[CustomerName])
but it did not give the results I was hoping for when I entered it into the matrix.
See screenshot below.
Thanks for the support.
parry2k- parry2kSuper User
Anonymous we are over complicating everything, paste sample data and expected output otherwise we will keep in going in circles.
- amitchandakSuper User
Anonymous , looking screenshot thing seems fine unless they are from two different tables which are NOT joined and you have taken a count distinct on the customer.
- AnonymousNot applicable
They come from only one table, namely "Dim Customer". One of the variables is called CustomerName. I used in the rows and in the values (as a distinct count).
- AnonymousNot applicable