Microsoft Fabric Community Conference 2025, March 31 - April 2, Las Vegas, Nevada. Use code MSCUST for a $150 discount.
Register nowThe Power BI DataViz World Championships are on! With four chances to enter, you could win a spot in the LIVE Grand Finale in Las Vegas. Show off your skills.
Hi
Let’s say I have data model that looks like this:
With this I can very easily create a report that shows all orders. I can also add a filter on products so only orders containing a specific product is shown.
But can I somehow adding a filter that makes it possible for the user to show all orders that contains product A, but not product B?
Solved! Go to Solution.
AFAIK, there's no such a exclude filter. A workaround I think of is to use a exclude table.
exclude Products = SELECTCOLUMNS ( FILTER ( FILTER ( CROSSJOIN ( SELECTCOLUMNS ( CROSSJOIN ( Orders, Products ), "OrderID_", Orders[OrderID], "ProductID_", Products[ProductID], "ProductName", Products[Name] ), SUMMARIZE ( OrderLine, OrderLine[OrderID], "ProductIDs", CONCATENATEX ( OrderLine, OrderLine[ProductID], "," ) ) ), [OrderID_] = OrderLine[OrderID] ), SEARCH ( [ProductID_], [ProductIDs],, 0 ) = 0 ), "OrderID", [OrderID_], "ProductName", [ProductName] )
See a demo, the Orders that contains Pasta but not Fish.
See more details from attached pbix.
AFAIK, there's no such a exclude filter. A workaround I think of is to use a exclude table.
exclude Products = SELECTCOLUMNS ( FILTER ( FILTER ( CROSSJOIN ( SELECTCOLUMNS ( CROSSJOIN ( Orders, Products ), "OrderID_", Orders[OrderID], "ProductID_", Products[ProductID], "ProductName", Products[Name] ), SUMMARIZE ( OrderLine, OrderLine[OrderID], "ProductIDs", CONCATENATEX ( OrderLine, OrderLine[ProductID], "," ) ) ), [OrderID_] = OrderLine[OrderID] ), SEARCH ( [ProductID_], [ProductIDs],, 0 ) = 0 ), "OrderID", [OrderID_], "ProductName", [ProductName] )
See a demo, the Orders that contains Pasta but not Fish.
See more details from attached pbix.
Thank you! That was very impressive 🙂
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!
If you love stickers, then you will definitely want to check out our Community Sticker Challenge!
User | Count |
---|---|
126 | |
78 | |
77 | |
60 | |
52 |
User | Count |
---|---|
165 | |
86 | |
68 | |
68 | |
58 |