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
mohittimpus
Helper V
Helper V

Calculate column sum and Measure Sum is different.

When I mutiple two column and divid by 100 this will give correct result in calculate column.

 

When I doing same thing in Measure then I got wrong result. 

 

Net Column = 'Skyline-SpinData'[Bet]*'Skyline-SpinData'[Lines]/100
 
Net Measure = SUM('Skyline-SpinData'[Lines])* SUM('Skyline-SpinData'[Bet])/100
 
Next Measure =
Var A = SUMX('Skyline-SpinData','Skyline-SpinData'[Lines])

var B = SUMx('Skyline-SpinData','Skyline-SpinData'[Bet])

Var c = A*B
Return

DIVIDE(C,100)
 
 
 
 
2 ACCEPTED SOLUTIONS
mahoneypat
Employee
Employee

You were on the right track with the use of SUMX.  SUMX is an iterator and can give you the calculated column result but dynamically.  Please try this measure instead

 

Next Measure =
DIVIDE (
SUMX ( 'Skyline-SpinData', 'Skyline-SpinData'[Lines] * 'Skyline-SpinData'[Bet] ),
100
)
 

If this works for you, please mark it as the solution.  Kudos are appreciated too.  Please let me know if not.

Regards,

Pat

 




Did I answer your question? Mark my post as a solution! Kudos are also appreciated!

To learn more about Power BI, follow me on Twitter or subscribe on YouTube.


@mahoneypa HoosierBI on YouTube


View solution in original post

amitchandak
Super User
Super User

@mohittimpus ,

Divide should be Sum(A)/Sum(B)

 

Multiplication should be sum(A*B)

 

Net Measure = SUMX('Skyline-SpinData','Skyline-SpinData'[Lines]*'Skyline-SpinData'[Bet])/100

Next Measure =
Var A = SUMX('Skyline-SpinData','Skyline-SpinData'[Lines]*'Skyline-SpinData'[Bet])

Return
DIVIDE(A,100)

View solution in original post

2 REPLIES 2
amitchandak
Super User
Super User

@mohittimpus ,

Divide should be Sum(A)/Sum(B)

 

Multiplication should be sum(A*B)

 

Net Measure = SUMX('Skyline-SpinData','Skyline-SpinData'[Lines]*'Skyline-SpinData'[Bet])/100

Next Measure =
Var A = SUMX('Skyline-SpinData','Skyline-SpinData'[Lines]*'Skyline-SpinData'[Bet])

Return
DIVIDE(A,100)

mahoneypat
Employee
Employee

You were on the right track with the use of SUMX.  SUMX is an iterator and can give you the calculated column result but dynamically.  Please try this measure instead

 

Next Measure =
DIVIDE (
SUMX ( 'Skyline-SpinData', 'Skyline-SpinData'[Lines] * 'Skyline-SpinData'[Bet] ),
100
)
 

If this works for you, please mark it as the solution.  Kudos are appreciated too.  Please let me know if not.

Regards,

Pat

 




Did I answer your question? Mark my post as a solution! Kudos are also appreciated!

To learn more about Power BI, follow me on Twitter or subscribe on YouTube.


@mahoneypa HoosierBI on YouTube


Helpful resources

Announcements
PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.