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

SumX not working properly - filter problem?

Hi 

I want to calculate my total netweight sold as a measure (not calculated column)

So I just want to multiply the qty sold with the netweight from my itemtable.

 

As you can see from the 2 matrix below the 2 measures "Netweight from Item" and "SUMX(ALLSelected-wrong" works fine in the first matrix where only items are included. However when customers are added in the 2 matrix you see the problem "Netweight from Item" is blank for 1 customer.

 

As you can see from the measure "Netweight from Item" I also tried removing filters from vDIM_customer table. But that cannot work as I then get a memory error.

 

So I hope you have another solution ?

 

Netweight from Item:

CALCULATE(
average(vDIM_Items[NetWeight])
, REMOVEFILTERS(DIM_Time)
// , REMOVEFILTERS(vDIM_Customer)
)

SUMX(ALLSelected-wrong:

sumx(allselected(vDIM_Items[ItemID]),CALCULATE([QTY]*[Netweight from Item]))

 

 

 

Dennis_Pedersen_1-1710927313691.png

 

 

 

 

2 REPLIES 2
v-xuxinyi-msft
Community Support
Community Support

Hi @Dennis_Pedersen 

 

You can try to modify the formula as follows:

 

Netweight from Item:

 

CALCULATE(
average(vDIM_Items[NetWeight])
, ALLSELECTED("Your table name", Yourcolumnname)
)

 

 

SUMX(ALLSelected-wrong:

sumx(allselected(vDIM_Items[ItemID]),[QTY]*[Netweight from Item])

 

If the problem persists, please provide detailed sample data: How to provide sample data in the Power BI Forum - Microsoft Fabric Community . Or show it as a screenshot or pbix. Please remove any sensitive data in advance. If uploading pbix files please do not log into your account.

 

Best Regards,
Yulia Xu

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Thanks but unfortunatetely it looks the same.

You mean formulas like below?

 

Netweight from Item:

CALCULATE(
average(vDIM_Items[NetWeight])
, ALLSELECTED(vDIM_Items[ItemID])

 

SUMX(ALLSelected-wrong:

sumx(allselected(vDIM_Items[ItemID]),[QTY]*[Netweight from Item])

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.