- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
2 Step Filter on dimension approach
Hi, I'm not sure if this can be resolved using dax but I need to filter my data in a simple matrix or table visual and it feels easy but I'm struggling with it. I need to filter all orders that contain a selected product but than show all products for those orders.
Simplefied example:
I want to be able to have a filter on the dimension product and the result should be the table at the end which is showing the som by product for all orders that contain the selected product. Can anyone help me with this please?
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi @SnoekL
For your question, here is the method I provided:
I used the data you provided
“FACT Orderlines”
Create a measure. Query all orders that contain the selected product.
Select_Product-Amount =
var select_product =
IF(
ISFILTERED('ProductDim'[Name]),
VALUES('ProductDim'[ID]),
BLANK()
)
var select_product_amount =
SUMX(
FILTER(
'FACT Orderlines',
CALCULATE(
CONTAINS(
'FACT Orderlines',
'FACT Orderlines'[ProductID],
select_product
),
ALLEXCEPT(
'FACT Orderlines',
'FACT Orderlines'[OrderID]
)
)
),
'FACT Orderlines'[Amount]
)
RETURN select_product_amount
Create a measure. Group and sum the product.
Product_amount =
SUMX(
FILTER(
ALL('FACT Orderlines'),
'FACT Orderlines'[ProductID] = MAX('FACT Orderlines'[ProductID])
),
[Select_Product-Amount]
)
Here is the result.
Regards,
Nono Chen
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thanks that works great 🙂
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi @SnoekL
For your question, here is the method I provided:
I used the data you provided
“FACT Orderlines”
Create a measure. Query all orders that contain the selected product.
Select_Product-Amount =
var select_product =
IF(
ISFILTERED('ProductDim'[Name]),
VALUES('ProductDim'[ID]),
BLANK()
)
var select_product_amount =
SUMX(
FILTER(
'FACT Orderlines',
CALCULATE(
CONTAINS(
'FACT Orderlines',
'FACT Orderlines'[ProductID],
select_product
),
ALLEXCEPT(
'FACT Orderlines',
'FACT Orderlines'[OrderID]
)
)
),
'FACT Orderlines'[Amount]
)
RETURN select_product_amount
Create a measure. Group and sum the product.
Product_amount =
SUMX(
FILTER(
ALL('FACT Orderlines'),
'FACT Orderlines'[ProductID] = MAX('FACT Orderlines'[ProductID])
),
[Select_Product-Amount]
)
Here is the result.
Regards,
Nono Chen
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Helpful resources
Subject | Author | Posted | |
---|---|---|---|
07-03-2023 02:53 AM | |||
05-28-2024 03:18 AM | |||
05-01-2024 02:29 PM | |||
01-19-2024 12:11 PM | |||
08-04-2023 08:43 AM |