'While dividing two measures in DAX, How can I get a SUM of the measure to display correctly? The divide function doesn't work for me

I have a DAX formula that i have used:

Price = DIVIDE([Sales Amount], [Net Sales Quantity])

My issue is that the SUM of Price is dividing the totals of Sales Amount and Net Sales Quantity instead of displaying the SUM of Price correctly.

Here's an example of what i see in Power BI:

Product Code Sales Amount Net Sales Quantity Price
AIU 70 10 7
JID 36 6 6
DII 10 5 2
TOTAL 116 21 5.5

As you can see above, the total for Price is not adding up column, instead its dividing the totals for Sales Amount and Net Sales Quantity which is 116/21 = 5.5

The actual result that I need is:

Product Code Sales Amount Net Sales Quantity Price
AIU 70 10 7
JID 36 6 6
DII 10 5 2
TOTAL 116 21 15

As you can see, its simply adding up the Price and SUM for the price is correct.

I'm new to power bi, i've looked at documentation and have not been able to solve this. Any help is appreciated!



Solution 1:[1]

You can try with Column instead of Measure

enter image description here

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 mkRabbani