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

Don't miss out! 2025 Microsoft Fabric Community Conference, March 31 - April 2, Las Vegas, Nevada. Use code MSCUST for a $150 discount. Prices go up February 11th. Register 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
Super User
Super User

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
Super User
Super User

hi @Sandhya877 ,

 

try like:

measure =

SUMX(

data,

data[quantity]*data[price]

)

tamerj1
Super User
Super User

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
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! Prices go up Feb. 11th.

Jan25PBI_Carousel

Power BI Monthly Update - January 2025

Check out the January 2025 Power BI update to learn about new features in Reporting, Modeling, and Data Connectivity.

Jan NL Carousel

Fabric Community Update - January 2025

Find out what's new and trending in the Fabric community.

Users online (538)