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

Be one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now

Reply

Problem with SumX

Hi 

 

I am trying to make a measure that is simply multiplying the sold QTY with the weight of each item.

 

The measure is working fine on some Styles(items), but on other styles there is no calculation, see below.

 

It seems it has something to do with my time dimension, which I do not understand, bacause the item dimension has no relation to the time dimension. But if I choose "All" in B1 instead og "2021", the style at the bottom is calculation correct.

But that is not a solution, I need to choose different years in B1.

 

Can anyone help with a measure working correct? See my measure below

 

New measure:=

VAR _weight= CALCULATE(
AVERAGEX(values(vDIM_Items[ItemID]),[NetWeight_])
, REMOVEFILTERS(DIM_Time))

return

sumx(values(vDIM_Items[ItemID]),[QTY]*_weight)

 

 

 

 

Weight.PNG

5 REPLIES 5
amitchandak
Super User
Super User

@Dennis_Pedersen , try with these small changes

 


New measure:=

VAR _weight=
AVERAGEX(values(vDIM_Items[ItemID]),CALCULATE([NetWeight_])
, REMOVEFILTERS(DIM_Time))

return

sumx(values(vDIM_Items[ItemID]),CALCULATE([QTY]*_weight))

Join us as experts from around the world come together to shape the future of data and AI!
At the Microsoft Analytics Community Conference, global leaders and influential voices are stepping up to share their knowledge and help you master the latest in Microsoft Fabric, Copilot, and Purview.
️ November 12th-14th, 2024
 Online Event
Register Here

Thank you amitchandak

 

Unfortunately the same result with no calculation on the last style. I really don't get it bacause the sold Qty is calculated correct on that style also, so it should be possible to calculate the weight also??

 

Also I changed you formula a bit:(before it said too many arguments for averageX function)

 

VAR _weight=
AVERAGEX(values(vDIM_Items[ItemID]),CALCULATE([NetWeight_]
, REMOVEFILTERS(DIM_Time)))

return

sumx(values(vDIM_Items[ItemID]),CALCULATE([QTY]*_weight))

@Dennis_Pedersen ,
Can you share sample data and sample output in table format? Or a sample pbix after removing sensitive data.

Join us as experts from around the world come together to shape the future of data and AI!
At the Microsoft Analytics Community Conference, global leaders and influential voices are stepping up to share their knowledge and help you master the latest in Microsoft Fabric, Copilot, and Purview.
️ November 12th-14th, 2024
 Online Event
Register Here

Hi amitchandak

 

Thank you - I have sent you a PM

Hi, @Dennis_Pedersen 

Could you please tell me whether your problem has been solved?

If not, please provide sanitized sample data that fully covers your issue. 

Best Regards,
Community Support Team _ Eason

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

Dec Fabric Community Survey

We want your feedback!

Your insights matter. That’s why we created a quick survey to learn about your experience finding answers to technical questions.

ArunFabCon

Microsoft Fabric Community Conference 2025

Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.

December 2024

A Year in Review - December 2024

Find out what content was popular in the Fabric community during 2024.