Forum Discussion

cortlin's avatar
cortlin
New Member
11 years ago
Solved

Margin % Calculation Column

Hello,  I'm new here, but was wondering if anyone could point me in the right direction as to how to perform a Margin % calcuation. I obviously have two columns "Sales" and "Cost". A simple calculat...
  • andre's avatar
    11 years ago

    I would not be creating Margin % calc as a column, you should create it as a measure and then you don't have to worry about how Margin % is being aggregated which is what you may be seeing when your numbers are off.

     

    Also, you should use the DIVIDE() function to make sure you don't get affected by zeros

     

    https://msdn.microsoft.com/en-us/library/jj677276.aspx

     

    so the calc should be something like this:

     

    Margin % = DIVIDE(SUM(mytable[revenue]) - Sum(mytable[cost]), Sum(mytable[Revenue]))