Forum Discussion
jaymanivannan
9 years agoFrequent Visitor
Calculated Measure with conditions
Hi, I am new to PowerBI. I am trying to create a calculated measure based on the condition. For Example, I am trying to create measure for the following condition SalesAverage= ((SUM(Total Sales...
- Anonymous9 years ago
jaymanivannan response is great. To add to this, rather than using the / symbol and have to make a divide by zero check, just use the Divide() function. I've also set this out using a spacing format, which is a good habit to get yourself into.
Here is an updateSalesAverage = DIVIDE( CALCULATE( SUM(Total Sales $), [AccountCode]=410000 ), CALCULATE ( Sum(Total Sales Quantity), [AccountCode]=420000 ) )
Anonymous
9 years agoNot applicable
jaymanivannan response is great. To add to this, rather than using the / symbol and have to make a divide by zero check, just use the Divide() function. I've also set this out using a spacing format, which is a good habit to get yourself into.
Here is an update
SalesAverage = DIVIDE(
CALCULATE(
SUM(Total Sales $),
[AccountCode]=410000
),
CALCULATE (
Sum(Total Sales Quantity),
[AccountCode]=420000
)
)
jaymanivannan
9 years agoFrequent Visitor
Anonymous, This is working !!!. Thanks for the quick response. No Zero divide error. Thank you once again.
- Anonymous9 years agoNot applicable
I want to thank Anonymous too. He did a lot of the work.