Forum Discussion
JohnLap
8 years agoFrequent Visitor
ON ADD COLUMN: DIVIDE() function with two columns yields wrong result?
I am new! I am probably missing something obvious!!! But after 12 hours of trying to figure this out I need help. Newest version Power BI Desktop. Just want to Divide two numeric columns. When I ...
- 8 years ago
Correction: The real solution was a little more complex
Transaction Var % Measure = (DIVIDE(CALCULATE(SUM('Table'[Count])),CALCULATE(SUM('Table'[PriorYear.Count])),0)-1)*100
This actually solves the problem.
Converting to a measure is required and will not work against a Direct Query.
Ashish_Mathur
Super User
8 years agoHi,
I am not sure of what that codde is doing but i assume that you want to first group by the 4th column and then add the numbers from the last 2 columns. If that be the case, then create a Table visua and drag the 4th column in the row labels. Then write these measures:
Total1 = SUM(Data[Total])
Total2 = SUM(Data[Completed])
Total3=[Total2]/[Total1]
Does that help?
Anonymous
8 years agoNot applicable
- Ashish_Mathur8 years ago
Super User
You are welcome.