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
TravisGlanzer
Frequent Visitor

SumX Total

I finally figured out a DAX to calculate the product of two attributes without creating a table:

 

TravisGlanzer_0-1614209723048.png

That produces the third column below which looks great.  The total row is off though as it is following the same logic.  

TravisGlanzer_1-1614209937131.png

If I add up the third column the true total should be 148,724, not 213,618.  I really do not use the total and can hide it.  The problem is that I am trying to create a formula for the 4th column that is the correct sum of all items in the 3rd column.  

 

I am using the following formula which is not working:  

 

WeightedCollStaffProcTotal = CALCULATE([WeightedCollStaffProc],All(BRG_PHLEBOTOMY_GROUP[Phlebotomy_Group]))

 

Suggestions?

 

1 ACCEPTED SOLUTION

Let me give you an example:
jameszhang0805_0-1614230241010.png

In the above picture :

SalesQty V1 = SUM( Sales[Quantity] )   
SalesQty V2 = [SalesQty V1] +1000
you can see the total number of SalesQty V2 is incorrect.  Because in the total line there is no filter.
So the calculation logic of the total number is to calculate all category sales quantity +1000, 140180+1000. But that's not your expectation. Your expectation is to SUM all the values in the Sales Qty V2 column in the matrix. At this time you need to do like the below picture to get the correct result.
jameszhang0805_1-1614231093864.png

 

View solution in original post

3 REPLIES 3
jameszhang0805
Resolver IV
Resolver IV

Hi, please try to use this method: Use SUMX+VALUES to wrap your Return.
SUMX(VALUES( the column of current row contents in your matrix ), Return Result)

 

Appreciate your response.  Feel very ignorant here as I am not quite sure what you mean.  Do you mean:

 

Sumx(Values(PhlebAttemptsper,Weightingper))

 

It keeps wanting a table.  Or are you suggesting in the next metric, "WeightedCollStaffProcTotal" to create the sumx?  I keep getting the request for a table name???

 

Let me give you an example:
jameszhang0805_0-1614230241010.png

In the above picture :

SalesQty V1 = SUM( Sales[Quantity] )   
SalesQty V2 = [SalesQty V1] +1000
you can see the total number of SalesQty V2 is incorrect.  Because in the total line there is no filter.
So the calculation logic of the total number is to calculate all category sales quantity +1000, 140180+1000. But that's not your expectation. Your expectation is to SUM all the values in the Sales Qty V2 column in the matrix. At this time you need to do like the below picture to get the correct result.
jameszhang0805_1-1614231093864.png

 

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.

Top Solution Authors