Forum Discussion
Divide in Power BI
- 6 years ago
Hi FarhanAhmed ,
For the data you share, you may create two measures instead of calculated column like DAX below.
% OTAS = DIVIDE(SUM('Data (2)'[OTAS] ), SUM('Data (2)'[Loads] )) % OTAW = DIVIDE(SUM('Data (2)'[OTAW] ), SUM('Data (2)'[Loads] ))Then you may choose Clustered column chart to display result, put [Stop] into Axis box of chart, put the new created measures [% OTAS] and % OTAW[] into Values box.
Note that the first link you shared can't be opened, and the [Loads] can't be found in your second pbix link, while it appears in forum shared data above, so does it really exist in your data table?
Best Regards,
Amy
Community Support Team _ Amy
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Anonymous , Divide should always be sum(A)/Sum(B). Sum can be count or other aggregation as needed.
% OTAW = divide(Sum('Data (2)'[OTAW]),sum('Data (2)'[Stop No])) //not sure if count is need in one of two
- Anonymous6 years agoNot applicable
I treied this one earlier but it does not work. I tried again once you mentioned but still not correct answer.
Column = DIVIDE(sum('Data (2)'[OTAS]),sum('Data (2)'[Stop No]))I belive I need to add another colomn.