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
alamhaz
Helper I
Helper I

SumX is giving wrong value

Hi 

I am calcultaing sum of the measure but its giving me wrong value, all meaure gives wrong value on row lelvel but one measure give me correct value when i filter with product, 

What i am doing is multplying total qty diff avg with avg selling price , i am getting correct result in Avg sale lost but its not giving total measure is 

IF([Total Qty Diff Avg] >0, [Total Qty Diff Avg] * [Avg Selling Price (PV)] ,BLANK())
after comupting this i am computing with sumx measure is 
Avg Sale lost (product ) = SUMX(VALUES('Product Movement'[Date]), [Avg Sale Lost]) and 
Avg Sale lost (total ) = SUMX(VALUES('Product Movement'[Prod Key Value]), [Avg Sale Lost])
both measure is not giving correct result even i tried in calculted column still getting wrong value.
Check the Screen shot Capture15.JPG
1 ACCEPTED SOLUTION
alamhaz
Helper I
Helper I

i figure out the solution , i am posting it may be someone needs. 

i change the measure as follow simply add the hasonfilter with my measure,

Avg Sale lost (product ) = IF(HASONEVALUE('Product Movement'[Date]),[Avg Sale Lost], BLANK())
then i use this measure 
Avg sale los f = if(HASONEVALUE('Product Movement'[Date])=TRUE(), [Avg Sale lost (product )],sumx(SUMMARIZE('Product Movement','Product Movement'[Product Name],'Product Movement'[Date]),[Avg Sale lost (product )]))
here i am removing filter on total and subtotal. you can read this belwo artical for more details 
 
 

View solution in original post

3 REPLIES 3
alamhaz
Helper I
Helper I

i figure out the solution , i am posting it may be someone needs. 

i change the measure as follow simply add the hasonfilter with my measure,

Avg Sale lost (product ) = IF(HASONEVALUE('Product Movement'[Date]),[Avg Sale Lost], BLANK())
then i use this measure 
Avg sale los f = if(HASONEVALUE('Product Movement'[Date])=TRUE(), [Avg Sale lost (product )],sumx(SUMMARIZE('Product Movement','Product Movement'[Product Name],'Product Movement'[Date]),[Avg Sale lost (product )]))
here i am removing filter on total and subtotal. you can read this belwo artical for more details 
 
 
amitchandak
Super User
Super User

@alamhaz , what is correct level based on visual ?

 

try like

SUMX(summarize('Product Movement','Product Movement'[Date],'Product Movement'[Prod Key Value],"_1", [Avg Sale Lost]),[_1])

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

no, giving only one value 34 

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!

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.