Forum Discussion
jp5481
6 years agoRegular Visitor
Compare two Columns
Guys, I have tried hard to figure out a formula to do this, but I'm unsuccessful. I need to compare two columns in a single table, and produce the results which follow. I don't know if I have a pre...
- 6 years ago
Hi jp5481 ,
You can modify Greg_Deckler 's DAX expression like this:
Table 10 = VAR __table = GENERATEALL ( DISTINCT ( SELECTCOLUMNS ( 'Table', "__customer", [Customers] ) ), DISTINCT ( SELECTCOLUMNS ( 'Table', "__product", [Products] ) ) ) VAR __table1 = ADDCOLUMNS ( __table, "number", COUNTROWS ( FILTER ( 'Table', [Products] = [__product] && [Customers] = [__customer] ) ) ) RETURN __tableBest Regards,
Icey
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
jthomson
6 years agoSolution Sage
Not sure why you can't just put both the columns in the row section of the matrix, and have the values be a count of the rows?
- jp54816 years agoRegular Visitor
jthomson wrote:Not sure why you can't just put both the columns in the row section of the matrix, and have the values be a count of the rows?
You are correct. However, I can't get what I really wanted this way -- I wanted to data to filter down to only who me customers that purchased multiple products, and to display the product names. Thank you for the suggestion.