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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
nj-matt
Helper I
Helper I

Help with ALLSELECTED by specific column summarized

I think there is a solve somewhere I am not thinking, but here is what I am trying to accomplish using the ALLSELECTED dax to summarize total sales -->

 

CustomerProductSalesTotal Sales
Drug StoreCandy Bars100400
Grocery StoreCandy Bars100400
Mass MerchGum100400
C-StoreCookies100400

 

Here is what I want, alway summarized dynamically by product -->

 

CustomerProductSalesTotal Sales
Drug StoreCandy Bars100200
Grocery StoreCandy Bars100200
Mass MerchGum100100
C-StoreCookies100100

 

I need it to be dynamic since other filters will routinely by applied (year, class of trade) but for that total sales column I need always at the parent product level. Is it possible withinnthe dax formula or do I need a new table?

1 ACCEPTED SOLUTION
MohammadLoran25
Super User
Super User

Hi @nj-matt ,

Try this:

Measuree =
CALCULATE (
    SUM ( CustomerProductSales[Sales] ),
    FILTER (
        ALLSELECTED ( CustomerProductSales ),
        CustomerProductSales[Product] = SELECTEDVALUE ( CustomerProductSales[Product] )
    )
)

 

It helped? Mark it as an accepted solution.

Regards,

Loran

View solution in original post

2 REPLIES 2
MohammadLoran25
Super User
Super User

Hi @nj-matt ,

Try this:

Measuree =
CALCULATE (
    SUM ( CustomerProductSales[Sales] ),
    FILTER (
        ALLSELECTED ( CustomerProductSales ),
        CustomerProductSales[Product] = SELECTEDVALUE ( CustomerProductSales[Product] )
    )
)

 

It helped? Mark it as an accepted solution.

Regards,

Loran

Success! Thanks so much, I knew it had to be something simple

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

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