Forum Discussion
sonm10
Helper I
4 years agoSlicer to filter two column without context
Hello, I have a sample dataset as follows: Product Category Type Seller Buyer Cost Product1 Cat1 Type1 A C 10 Product2 Cat2 Type1 C A 20 Product3 Cat2 Type2 C B 30 ...
- 4 years ago
sonm10
I created a new table combining Seller and Buyer with distinct values then created a measure that identifies if the selected values (One or more) is found then filters the table. Check the attached fileExists = VAR __SellerBuyerSelected = VALUES( BuyerSeller[Buyer] ) RETURN CALCULATE( COUNTROWS(table1), Table1[Buyer] IN __SellerBuyerSelected || Table1[Seller] IN __SellerBuyerSelected )
Fowmy
Super User
4 years agosonm10
I created a new table combining Seller and Buyer with distinct values then created a measure that identifies if the selected values (One or more) is found then filters the table. Check the attached file
Exists =
VAR __SellerBuyerSelected = VALUES( BuyerSeller[Buyer] )
RETURN
CALCULATE(
COUNTROWS(table1),
Table1[Buyer] IN __SellerBuyerSelected || Table1[Seller] IN __SellerBuyerSelected
)
- sonm104 years ago
Helper I
Fowmy, Thanks for your solution. It is working as expected however, when we only have the buyer, seller and cost columns in the table, the silcer is not working. For that, I have added an additional field (although not required in that particular table) for the slicer to work.