Forum Discussion
MarianaBotelho
10 years agoMicrosoft Employee
Divide row by row
Hi guys, I've been having a little problem doing some math. I have the following table Time Banana Apple 1300-1305 1000 50 1305-1310 2000 30 1310-1315 3000 10...
sdjensen
10 years agoSolution Sage
MarianaBotelho - could you perhaps show the result that you want.
I have created this small sample on your data and can get some different results:
Ratio is calculated as a measure with this formula: (I am still trying to understand why the total for this is 200)
Ratio = SUMX( Table1, DIVIDE( SUM(Table1[Banana]), SUM(Table1[Apple]) ) )
RatioColumn is calculated as a column in the table with this formula: (from what you write I think this is what you want)
RatioColumn = DIVIDE( Table1[Banana], Table1[Apple] )
sdjensen
10 years agoSolution Sage
Basically I would always advise you to solve your calculations with measures if posible and you can get Ratio to return the same total as the calculated column if you make a small change to the DAX formula.
Here is the formula that will return the same as the calculated column.
Ratio = SUMX( Table1, DIVIDE( CALCULATE( SUM(Table1[Banana]) ), CALCULATE( SUM(Table1[Apple]) ) ) )