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

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

Reply
Anonymous
Not applicable

How to calculate column total value by making use of measure to calculate row totals?

Dear All,

 

I face the following situation:

 

Power_BI_Adapt_0-1670927899651.png

Total column is calculated by making use of the following measure: 

 

CALCULATE(sum('Table 1'[Number sold]))* sum('Table 1'[Unit price])

 

However to get a total row of this 'Total 'column the measure is still executing its logic, resulting in a wrong total of the 'Total' column. In example: result is 234  (13 * 18), but should be 87 (sum of the values in the three rows). 

 

Any suggestion to fix?

 

Kind regards,

1 ACCEPTED SOLUTION
AntonioM
Solution Sage
Solution Sage

Hi @Anonymous ,

 

Please try this measure

 

SUMX( 'Table 1', 'Table 1'[Number sold] * 'Table 1'[Unit price] )

 

 

This will sum up one row at a time the calculation.

View solution in original post

1 REPLY 1
AntonioM
Solution Sage
Solution Sage

Hi @Anonymous ,

 

Please try this measure

 

SUMX( 'Table 1', 'Table 1'[Number sold] * 'Table 1'[Unit price] )

 

 

This will sum up one row at a time the calculation.

Helpful resources

Announcements
LearnSurvey

Fabric certifications survey

Certification feedback opportunity for the community.

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.