Forum Discussion

Mana_786's avatar
Mana_786
Frequent Visitor
8 years ago
Solved

Gross Margin

Hi Dear All,

I hope some body can guide me properly .I have a probelm to get figures from Gross margin in Power BI.

My Data type is somehow like this.

 

Branch No          Branch Name     Area         Entity       month    Year          sales          GM          GM%(GM/Sales)

  01                      A                      A               S             1            2017       3000         1000         33%

  02                      B                       A               T              1           2017       2000          1000         50%

 

So like in this formate I have data in excel sheet . I have data for 10 month for more then 50 Branches .So the main problem is this after importing data in Power BI I want to have gross margin calculation .When I want to have Gross margin for Araea A It give totaly wrong result In Card Diagram . Normaly It should calculate Gross margin from arae A or (branch   1+2) and divded into sales from Area A or(Branche 1+2). But actualy in card diagram it gives average from this result mean it just devided by 2 as normal.

I would like to have a proper detail if somebody can give .

Thanks in Advance

 

  • Hi Mana_786,

    You need to create a measure to calculate the total Gross margin using the formula below.

    GM percentage = DIVIDE(SUM(Table1[GM]),SUM(Table1[Sales]))


    Please see the expected result, 40%=(1000+1000)/(3000+2000).



    Best Regards,
    Angelia

3 Replies

  • v-huizhn-msft's avatar
    v-huizhn-msft
    Icon for Microsoft Employee rankMicrosoft Employee

    Hi Mana_786,

    You need to create a measure to calculate the total Gross margin using the formula below.

    GM percentage = DIVIDE(SUM(Table1[GM]),SUM(Table1[Sales]))


    Please see the expected result, 40%=(1000+1000)/(3000+2000).



    Best Regards,
    Angelia

    • Mana_786's avatar
      Mana_786
      Frequent Visitor

      Thank you very much that work well.

    • gabriele's avatar
      gabriele
      Regular Visitor

      In this solution there are a problem. If we have costs but revenue are 0, this formula return blank or optional value for zero division exception. I think that the real %profit must be " -100%"