Forum Discussion
Profit Per unit
- 8 years ago
Hi,
I guess you computed your Profit per unit as a calculated column using the DAX language in Power BI.
Because this is a ratio, you'd better use a measure rather than a calculated column. See more explanation here: https://exceleratorbi.com.au/calculated-columns-vs-measures-dax/
Ralph Kimball summarizes this concept with this sentence : "You should always do the ratios of the sum rather than the sum of the ratios"
So, in your example, go to 'Modelling' Tab, create the following measure:
ProfitPerUnit = Divide ( Sum(YourTable[Profit]) , Sum(YourTable[Unit]) , 0)
And use this brand new measure in the "values" of your tables & matrix.
Hi,
I guess you computed your Profit per unit as a calculated column using the DAX language in Power BI.
Because this is a ratio, you'd better use a measure rather than a calculated column. See more explanation here: https://exceleratorbi.com.au/calculated-columns-vs-measures-dax/
Ralph Kimball summarizes this concept with this sentence : "You should always do the ratios of the sum rather than the sum of the ratios"
So, in your example, go to 'Modelling' Tab, create the following measure:
ProfitPerUnit = Divide ( Sum(YourTable[Profit]) , Sum(YourTable[Unit]) , 0)
And use this brand new measure in the "values" of your tables & matrix.
- JeffreyLau8 years agoNew Member
Thanks, it works now. I tried the new measure before but did not know "Divide". Now I know. Thanks.