admin管理员组文章数量:1296392
have this setup
Table1: Customers - Column: CustomerId, Name Table2: Products - Column: ProductId, Name Table3: CustomerProduct - Column: ProductsId, CustomersId
Relationship: 1-to-many between Customers[CustomerId] > CustomerProduct[CustomersId] Relationship: 1-to-many between Products[ProductId] > CustomerProduct[ProductsId]
On my report i have 1 slicer that is based on Products[Name] -slicer is setup to allow multiple selections.
I have one table visual that have Customers[Name]
I want to filter my table visual - when i select two or more products in the slicer. I want to see Customers that have ALL selected products.
Example:
I select Product "aa" - that product is owned by customer "A" and "E"
- table shows now customer A and E.
I then ALSO select Product "cc" - that product is owned by customer "E" and "J"
- table shows now only customer E, since customer E is the only owner of product "aa" and "cc".
I then reset my selection (in slicer) and select Product "aa" and "bb"
- table show now only customer A and E since both selected products is owned by customer A and E.
If slicer have no selections, table should be empty. All selected products in slicer must be owned by the Customer showed in the table.
EXAMPLE FILE:
I have tried several different methods. I am not that good with DAX and have mostly searched around using normal Googling and AI to try and figure out a method on how to do this. But so far i have not been able. I found a youtube video here: ;feature=youtu.be It seems to contain my answer, but i cant convert it to my report...
have this setup
Table1: Customers - Column: CustomerId, Name Table2: Products - Column: ProductId, Name Table3: CustomerProduct - Column: ProductsId, CustomersId
Relationship: 1-to-many between Customers[CustomerId] > CustomerProduct[CustomersId] Relationship: 1-to-many between Products[ProductId] > CustomerProduct[ProductsId]
On my report i have 1 slicer that is based on Products[Name] -slicer is setup to allow multiple selections.
I have one table visual that have Customers[Name]
I want to filter my table visual - when i select two or more products in the slicer. I want to see Customers that have ALL selected products.
Example:
I select Product "aa" - that product is owned by customer "A" and "E"
- table shows now customer A and E.
I then ALSO select Product "cc" - that product is owned by customer "E" and "J"
- table shows now only customer E, since customer E is the only owner of product "aa" and "cc".
I then reset my selection (in slicer) and select Product "aa" and "bb"
- table show now only customer A and E since both selected products is owned by customer A and E.
If slicer have no selections, table should be empty. All selected products in slicer must be owned by the Customer showed in the table.
EXAMPLE FILE: https://1drv.ms/u/c/7fb4de7a296ed17a/EcwRtrdY6HZPvLmIzfbmXxgBmPwY1PedlDIp2FtgcqYxiw?e=7tMfNe
I have tried several different methods. I am not that good with DAX and have mostly searched around using normal Googling and AI to try and figure out a method on how to do this. But so far i have not been able. I found a youtube video here: https://www.youtube/watch?v=X5T4rIZovHk&feature=youtu.be It seems to contain my answer, but i cant convert it to my report...
Share Improve this question asked Feb 11 at 19:38 BehedwinBehedwin 373 silver badges9 bronze badges 1- not clear about your question. What's the expected output? when you select aa and cc, which customer do you want to display? – Ryan Commented Feb 12 at 0:50
1 Answer
Reset to default 1I solved it. This was my solution. Create a meassure
Has All Selected Products =
VAR SelectedProducts = VALUES(Products[ProductId])
VAR CustomerProducts =
CALCULATETABLE(
VALUES(CustomerProduct[ProductsId]),
ALLEXCEPT(Customers, Customers[CustomerId])
)
VAR IntersectedProducts = INTERSECT(SelectedProducts, CustomerProducts)
RETURN
IF(
COUNTROWS(IntersectedProducts) = COUNTROWS(SelectedProducts),
1,
0
)
Then filter the table visual on this measure equal 1
本文标签:
版权声明:本文标题:dax - How to filter PowerBi table based on multiselect slicer - combination of selected slicer values - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1741638381a2389772.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论