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
Alexbienvenue
Frequent Visitor

Incorrect total

Hello everyone, having difficulty solving for a correct total, any and all help appreciated

 

dax Q attempt II.jpg

 

for context here I need every [SKU] to Display the [juice] in it and display the amount that was "Pressed". The reason I have ALLEXCEPT is that not every [SKU] has an [action] = 'Press" but every [Juice] does. The total amount that is displayed at the bottom is just the sum total of all "press"...not sure why its summing that way 

1 ACCEPTED SOLUTION
v-yalanwu-msft
Community Support
Community Support

Hi, @Alexbienvenue ;

Try it.

test = 
SUMX (
    SUMMARIZE (
        'Wine Processing',
        [Juice],
        [Sku],
        "1",
            CALCULATE (
                SUM ( 'Wine Processing'[Amount] ),
                'Wine Processing'[Action] = "Press",
                ALLEXCEPT ( 'Wine Processing', 'Wine Processing'[Juice] )
            )
    ),
    [1]
)

Or 

test 2 = SUMX(
SUMMARIZE('Wine Processing',[Sku],[Juice],"1",

CALCULATE (
    SUM ( 'Wine Processing'[Amount] ),
    FILTER (
        ALL ( 'Wine Processing' ),
        'Wine Processing'[Action] = "Press"
    ),
    VALUES ( 'Wine Processing'[Juice] )
)),[1])

The final show:

Snipaste_2022-08-02_15-53-37.jpg

Best Regards,
Community Support Team _ Yalan Wu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

3 REPLIES 3
v-yalanwu-msft
Community Support
Community Support

Hi, @Alexbienvenue ;

Try it.

test = 
SUMX (
    SUMMARIZE (
        'Wine Processing',
        [Juice],
        [Sku],
        "1",
            CALCULATE (
                SUM ( 'Wine Processing'[Amount] ),
                'Wine Processing'[Action] = "Press",
                ALLEXCEPT ( 'Wine Processing', 'Wine Processing'[Juice] )
            )
    ),
    [1]
)

Or 

test 2 = SUMX(
SUMMARIZE('Wine Processing',[Sku],[Juice],"1",

CALCULATE (
    SUM ( 'Wine Processing'[Amount] ),
    FILTER (
        ALL ( 'Wine Processing' ),
        'Wine Processing'[Action] = "Press"
    ),
    VALUES ( 'Wine Processing'[Juice] )
)),[1])

The final show:

Snipaste_2022-08-02_15-53-37.jpg

Best Regards,
Community Support Team _ Yalan Wu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Jihwan_Kim
Super User
Super User

Hi,

I am not sure how your filter context is designed on the page, but please try the below.

 

 

test measure: =
CALCULATE (
    SUM ( 'Wine Processing'[Amount] ),
    FILTER (
        ALLSELECTED ( 'Wine Processing' ),
        'Wine Processing'[Action] = "Press"
    ),
    VALUES ( 'Wine Processing'[Juice] )
)

 


If this post helps, then please consider accepting it as the solution to help other members find it faster, and give a big thumbs up.


Click here to visit my LinkedIn page

Click here to schedule a short Teams meeting to discuss your question.

Hello @Jihwan_Kim ,

 

Thank you for the attmept. Using your DAX this is created:
DAX Attempt II 2 .jpg

 

This is closer but incorrect, playing with the selection filter leads me to believe its excluding two of the rows in that table 

the 2021_Rose & 2021_Riesling_Dry are not being calculated when they have 2021_riesling_01 as a juice. this is becuase I know there is no Press = "Action" for those two. 

Helpful resources

Announcements
July 2025 community update carousel

Fabric Community Update - July 2025

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

July PBI25 Carousel

Power BI Monthly Update - July 2025

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