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

Calling all Data Engineers! Fabric Data Engineer (Exam DP-700) live sessions are back! Starting October 16th. Sign up.

Reply
LuITS
Helper II
Helper II

DAX Measure, Total is wrong

Hello I have problems converting formulas into DAX measure,

 

Measure 1:
SUM(Quantity) / SUM( Quantitiy / Goal )

My try:

DIVIDE('Table'[Quantity], SUMX('Table', DIVIDE('Table'[Quantity], 'Table'[Goal])))

 

Measure 2:
Other Measure / Measure 1

My try:

DIVIDE('Table'[Other Measure], 'Table'[Measure 1])

 

Problem is, that Calculations in Table Visual are right, but Total of Measure 2 is not correct. Measure 2 is displayed in %.

 

Output:

QuantityGoalMeasure 1Other MeasureMeasure 2
1582.4002.4004.277178,2 %
1.7343.3003.3002.85786,6 %
5642.6502.6502.09379,0 %
1302.4002.4001.91079,6 %
Total                       2.586  2.63588,4%

 

All values are correct, but total of Measure 2 is off and should be 87,5%

 

can u help?

1 ACCEPTED SOLUTION

Hi, i actually had an error in my data. Thanks for your help anyways.

View solution in original post

6 REPLIES 6
rohit1991
Super User
Super User

Corrected DAX:

  1. Measure 1: Measure 1 = DIVIDE(SUM('Table'[Quantity]), SUMX('Table', DIVIDE('Table'[Quantity], 'Table'[Goal]))

  2. Measure 2 (Fix Total): Use SUMX to correctly calculate the total: Measure 2 = VAR TotalQuantity = SUM('Table'[Quantity]) VAR TotalOtherMeasure = SUM('Table'[Other Measure]) VAR TotalMeasure1 = DIVIDE(TotalQuantity, SUMX('Table', DIVIDE('Table'[Quantity], 'Table'[Goal])))
    RETURN DIVIDE(TotalOtherMeasure, TotalMeasure1)

  3. This ensures the total recalculates correctly as 87.5%.

 


Did it work? ✔ Give a Kudo • Mark as Solution – help others too!

Hi, i actually had an error in my data. Thanks for your help anyways.

FarhanJeelani
Super User
Super User

 

The issue with the incorrect total for your Measure 2 lies in how Power BI calculates totals for measures. By default, Power BI aggregates the row-level results, which can lead to discrepancies when the logic of the measure depends on row-level context. Instead, you need to adjust the logic of the measure to calculate the total correctly.

 

For Measure 2, instead of summing the row-level results, we should calculate the overall total using the same logic applied at the row level.

Measure 1:

DAX
Measure 1 =
DIVIDE( SUM('Table'[Quantity]), SUMX('Table', DIVIDE('Table'[Quantity], 'Table'[Goal])) )
 

Measure 2 (Adjusted for Total):

DAX

Measure 2 =
DIVIDE( SUM('Table'[Other Measure]), SUMX('Table', DIVIDE('Table'[Quantity], 'Table'[Goal])) )
 
If this post helps, then please consider Accepting it as the solution to help the other members find it more quickly.

Hi, thanks for youre reply but i get error.

 

When i try to use Measure 2 i get following Error:
Collumn Other Meassure not found or cant be used in this expression.

 

DAX of Other Meassure: DIVIDE(SUM('Table'[Quantity], SUM('Table'[Time])) * 60

Use below:

 Other Measure:

Other Measure = DIVIDE(SUM('Table'[Quantity]) + SUM('Table'[Time]), 1) * 60

 

Measure 2:

 Measure 2 = DIVIDE(

[Other Measure], SUMX('Table', DIVIDE('Table'[Quantity], 'Table'[Goal])) )

 

Hi, i actually had an error in my data. Thanks for your help anyways.

Helpful resources

Announcements
FabCon Global Hackathon Carousel

FabCon Global Hackathon

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!

September Power BI Update Carousel

Power BI Monthly Update - September 2025

Check out the September 2025 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.