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

Vote for your favorite vizzies from the Power BI Dataviz World Championship submissions. Vote now!

Reply
Sandhya877
Frequent Visitor

Row level Totals - Miscalculation

Hi,

I am trying to calculate the total price as shown below. 

 

DAX measure i am using is = sum(quantity) * sum(price) 

 

Instead of caluclating this way : (10 *4) + (20*5) + (30*6)

i am getting total based on this logic: (10+20+30) * (4+5+6)

 

How to create a measure for this logic

(10 *4) + (20*5) + (30*6)

 

I only need to show the entire total. 

 

 

CategoryNameQuantityPriceTotal 
FruitsApple10440 
Fruitsorange205100 
Fruitsbanana306180 
    320Expected Outcome
  6015900This is outcome i am getting in Power BI
1 ACCEPTED SOLUTION
tamerj1
Community Champion
Community Champion

Hi @Sandhya877 

to force summing the visible values 

Measure =
SUMX (
SUMMARIZE ( 'Table', [Category], [Name] ),
CALCULATE ( SUM ( [Quantity] ) * SUM ( [Price] ) )
)

View solution in original post

3 REPLIES 3
FreemanZ
Community Champion
Community Champion

hi @Sandhya877 ,

 

try like:

measure =

SUMX(

data,

data[quantity]*data[price]

)

tamerj1
Community Champion
Community Champion

Hi @Sandhya877 

to force summing the visible values 

Measure =
SUMX (
SUMMARIZE ( 'Table', [Category], [Name] ),
CALCULATE ( SUM ( [Quantity] ) * SUM ( [Price] ) )
)

Thank you. It worked.

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

Vote for your favorite vizzies from the Power BI World Championship submissions!

Sticker Challenge 2026 Carousel

Join our Community Sticker Challenge 2026

If you love stickers, then you will definitely want to check out our Community Sticker Challenge!

January Power BI Update Carousel

Power BI Monthly Update - January 2026

Check out the January 2026 Power BI update to learn about new features.

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Users online (5,849)