Forum Discussion
ScottKC
3 years agoFrequent Visitor
Aggregating conditional distinct counts
hi all How could I achieve the following in a measure? An aggregate count of distinct Customers who had sales in all Channels (A,B,C)? Date CustomerName Channel SaleAmount 22/01/2023 L...
- 3 years ago
I think logic like the following should work
All Channels Count = // get the list of customers and count the distinct channels for each customer var CustChannels = summarize('Table', 'Table'[CustomerName], "ChannelCount", DISTINCTCOUNT( 'Table'[Channel])) // get the total distinc channels regardless of the filter context var distinctChannels =COUNTROWS(DISTINCT(ALL('Table'[Channel]))) // count the customers where the number of channels is the same as to the total distinct channels return countrows(Filter(CustChannels, [ChannelCount] = distinctChannels))This is giving me the output on the last column
ninjaryder1st
3 years agoNew Member
I have a similar challenge:
Trying to count unique names (same people repeatedly occur in table rows) in a table based on some other column's categorical status:
Homer
Marge
Maggie
Bart
Maggie
Maggie
Bart
They all have a categorical status of "Red, Blue, or Green" and I wanted to count each employee only once, that hs "red" status. Can't seem to find the DAX expression for this, or steps to create columns or measures to do this.
Thanks