Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply
ay5h
Regular Visitor

Measure to sum the items associated to a selected set of items from another field in the same dim

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:

 

ay5h_0-1656083808122.png

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:

ay5h_1-1656084123892.png

 

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

 

4 REPLIES 4
Anonymous
Not applicable

Thanks @Anonymous , I am looking at your suggestion and will let you know if I am able to adapt it to resolve this question.

amitchandak
Super User
Super User

@ay5h , Try like

 

CALCULATE ( [Sales],FILTER ( ALL ( 'Product' ), 'Product'[Color] = max('Product'[Color])))

 

or


CALCULATE ( [Sales],FILTER ( ALLSELECTED ( 'Product' ), 'Product'[Color] = max('Product'[Color])))

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

Thanks @amitchandak but unfortunately this doesn't give me the result I was hoping for!

Helpful resources

Announcements
August Power BI Update Carousel

Power BI Monthly Update - August 2025

Check out the August 2025 Power BI update to learn about new features.

August 2025 community update carousel

Fabric Community Update - August 2025

Find out what's new and trending in the Fabric community.