Forum Discussion
Slicer In Table A filters Table B based on multiple conditions
Anonymous
You are going to want to unpivot table B so you have customers in a column. Then you can join your customer table into the inventory table using the customer ID.
| Product | Customer | Inventory |
| Hamburger | A | 0 |
| Hot Dog | A | 1 |
| French Fries | A | 0 |
| Soda | A | 1 |
| Cheese Burger | A | 0 |
| Ice Cream | A | 1 |
| Cake | A | 0 |
| Candy Bar | A | 1 |
| Sausage | A | 0 |
| Hamburger | B | 1 |
| Hot Dog | B | 0 |
| French Fries | B | 1 |
| Soda | B | 0 |
| Cheese Burger | B | 1 |
| Ice Cream | B | 0 |
| Cake | B | 1 |
| Candy Bar | B | 0 |
| Sausage | B | 1 |
The data then wouldn't aggregate correctly though. It would show more inventory than is truly available if more than one customer is selected.
For example, a single hot dog in the warehouse can be available to multiple customers (although not all customers). if i unpivot the data the report will show that there is more hot dogs in our inventory than are truly available in the warehouse.
- jdbuchanan716 years ago
Super User
You are probably going to need something like this where the total inventory lives on the products table.
Then you can write an inventory amount measure to check if there is a single customer selected and if not sum off the total inventory rather than the customer inventory.
Inventory Amount = IF ( HASONEVALUE ( Customers[Customer] ), SUM ( 'Customer Inventory'[Inventory] ), SUM ( Products[Inventory] ) )- Anonymous6 years agoNot applicable
I've already done something like this. I am able to have either one or all customers selected. However this won't work if multiple (but not all) customers are selected from what i can tell.
- dax6 years ago
Community Support
Hi Anonymous ,
Did you refer to my sample? it could work when you select multiple customers, and the Total column will show the status of storage. If this is not what you want, please correct me and inform me more detailed infromation(your expected output).
Best Regards,
Zoe ZhiIf this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
- dax6 years ago
Community Support
Hi Anonymous ,
I am not sure your requirement, you could referto my sample for details. If this is not waht you want, please correct me and inform me your expected output.
Best Regards,
Zoe ZhiIf this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
- Anonymous6 years agoNot applicable
I need a single column in the matrix that displays counts available inventory. This column must filter for the selected customers (whether it be a single, multiple, or all customers).