March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Early bird discount ends December 31.
Register NowBe one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch 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!
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!
Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.
User | Count |
---|---|
21 | |
14 | |
11 | |
8 | |
5 |
User | Count |
---|---|
24 | |
21 | |
20 | |
15 | |
10 |