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

Score big with last-minute savings on the final tickets to FabCon Vienna. Secure your discount

Reply
Ttaylor9870
Helper III
Helper III

DAX Help, why are the changed values not totalling properly?

Hi Everyone,

 

I have been scratching my head about a problem I'm currently having,

When I change a columns value the total will not display the correct total it still counts the total as if the old values were still present.

 

I've went and made some dummy example data if soomeone could help me and below is an example of the table I am trying to build...

 

Ttaylor9870_0-1673872091175.png

 

 

 

 

 

Ttaylor9870_1-1673871801523.png

 

 

Relationship has be be like this because this is just a sample from the table columns that I've needed.

 

I need to do: Total Outstanding Quantity -  Total Quantity

 

And then assign all negative values from this equation to zeros, then multiply this equation by the Selling price.

 

Here are my Tables...

 

Item NoQuantity
15
210
38
435
56
615
716
817
918
1019

 

No

Selling

Selling Price

Prod Group
15AAA
26BBB
37CCC
48DDD
59EEE

 

 

NoOutstanding QuantityLocation Code
110OOOOOO
220LLLLLLLLLL
330MMMMMM
440PPPPPPPPPP
53SSSSSSSSSSS
68GGGGGGGGGG
79FFFFFFFFFF
83BBBBBBBBB
95NNNNNNNNN
106SSSSSSSSSSS

Many Thanks,

 

Taylor

1 ACCEPTED SOLUTION
tamerj1
Super User
Super User

Hi @Ttaylor9870 
You need to iterate the products

Result =
SUMX (
    Nav_Item,
    VAR CurrentItemPrice = Nav_Item[Selling Price]
    VAR DifferenceValue = [Total Outstanding Quantity] - [Total Quantity]
    RETURN
        IF ( DifferenceValue > 0, DifferenceValue * CurrentItemPrice )
)

View solution in original post

1 REPLY 1
tamerj1
Super User
Super User

Hi @Ttaylor9870 
You need to iterate the products

Result =
SUMX (
    Nav_Item,
    VAR CurrentItemPrice = Nav_Item[Selling Price]
    VAR DifferenceValue = [Total Outstanding Quantity] - [Total Quantity]
    RETURN
        IF ( DifferenceValue > 0, DifferenceValue * CurrentItemPrice )
)

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.