Forum Discussion
Filter Table in special way based on column from another table
- 2 years ago
Click here to download solution
How it works ...
Create a related and unrelated copy of shop table.
Use one to pick (slice) and the other to display.
Otherwise it is complicated to slice a shop and display the other shops !Create a measure
Is Valid Customer = VAR pickshop = SELECTEDVALUE('Shop picklist'[CofeeshopID]) -- getspicked shop id VAR customers = -- get list of customers who visted picked shop CALCULATETABLE( VALUES(Sales[Customer]), ALL(Sales), Sales[Coffeeshop ID] = pickshop) VAR thisshop = SELECTEDVALUE(Sales[Coffeeshop ID]) -- get shop being output VAR thiscustomer= SELECTEDVALUE(Sales[Customer]) -- get customer being output RETURN SWITCH(TRUE(), thisshop = pickshop, "N", -- ignore picked shop thiscustomer in customers, "Y" -- flag customers who are in the list )Fiter you reports using the measure
Pay great care to use the correct table and field names.
iI you use the shop or the customer from the wrong table then the solutoon wont work.
Download my example and copy the code.Thanks for the clear description of the problem with example data. I wish everyone did that!
Remember we are unpaid volunteers and you are receiving expert free help.
This solution works and does exactly what you asked.
So please be polite and quickly click the [accept as solution] and thumbs up and the button to leave kudos.One question per ticket please. If you need to change or extend your request then please raise a new ticket.
You will get a quicker response and each volunteer solver will get the kudos they deserve. Thank you !
If you quote speedramps in your next tickets then I will then receive an automatic notification, and will be delighted to help you again.
Thanks a lot! This solution works exactly as needed