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
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
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.