Forum Discussion
Anonymous
9 years agoNot applicable
Help with formula returning information instead of null
How can I rewrite the highlighted formula so that it will be blank instead of 100% for the months in the future on the "Average Margin" tile? I want it to be blank like all the rest of the tiles to the right of it.
Margin% = DIVIDE ( SUM ( AvgPricePer[Invoice Charge] ) - SUM ( AvgPricePer[Cost] ), SUM ( AvgPricePer[Invoice Charge] ), 0 )
2 Replies
- Phil_Seamark
Microsoft Employee
Hi Anonymous
You could try it using IF. So somthing along the lines of this
Margin% = IF( (1-(sum(AvgPricePer[Cost]) / sum(AvgPricePer[Invoice Charge]))) = 1 , BLANK(), 1-(sum(AvgPricePer[Cost]) / sum(AvgPricePer[Invoice Charge])) )
Also you might want to have a look into the DIVIDE function
So rather that write x = y / z
you can write x = DIVIDE(y,z) to get better results
- Sean
Community Champion
Margin% = DIVIDE ( SUM ( AvgPricePer[Invoice Charge] ) - SUM ( AvgPricePer[Cost] ), SUM ( AvgPricePer[Invoice Charge] ), 0 )