Starting December 3, join live sessions with database experts and the Microsoft product team to learn just how easy it is to get started
Learn moreGet certified in Microsoft Fabric—for free! For a limited time, get a free DP-600 exam voucher to use by the end of 2024. Register now
I have a scenario where I have a slicer to select multiple products from a Product dimension. The products have various attributes for example Color or Product Line.
I need to create a sales total for all the Colors associated to the selected products. E.g. here I have used a slicer to pick two products and the associated colors are Blue and Silver:
I need a measure that totals all Sales for Blue and Silver products, ignoring any filters on Product Name or Product Line.
I have tried the following:
Sales for Color =
VAR _tbl = SUMMARIZE ( ALLSELECTED ( 'Product' ), 'Product'[Color] )
RETURN
CALCULATE (
[Sales],
FILTER ( ALL ( 'Product' ), 'Product'[Color] IN _tbl )
)
But this measure gets filtered if I additionally add a slicer on Product Line:
How can I create the measure in a way that ignores any additional filters on the Product dimension?
I have attached a pbix with this example in further detail (1st page without an additional filter and a 2nd page showing the problem when filters are applied).
https://www.dropbox.com/s/0o3wgkvht3hnw5g/Question%20on%20DAX.pbix?dl=0
llo
Try with this method. I think it could work
https://www.sqlbi.com/articles/apply-and-logic-to-multiple-selection-in-dax-slicer/
Thanks @Anonymous , I am looking at your suggestion and will let you know if I am able to adapt it to resolve this question.
@ay5h , Try like
CALCULATE ( [Sales],FILTER ( ALL ( 'Product' ), 'Product'[Color] = max('Product'[Color])))
or
CALCULATE ( [Sales],FILTER ( ALLSELECTED ( 'Product' ), 'Product'[Color] = max('Product'[Color])))
Thanks @amitchandak but unfortunately this doesn't give me the result I was hoping for!
Starting December 3, join live sessions with database experts and the Fabric product team to learn just how easy it is to get started.
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Early Bird pricing ends December 9th.
User | Count |
---|---|
25 | |
21 | |
20 | |
14 | |
13 |
User | Count |
---|---|
43 | |
37 | |
25 | |
24 | |
23 |