Forum Discussion

Tuan's avatar
Tuan
Helper III
6 years ago
Solved

% of Row

Been trying to figure this out. I have Row data that has Sales and Expenses in the same column but on the row level. I'm trying to figure out how to get a % of Sales.

 

I want the Sales value to be repeated down the rows so I can do a % of Sales. When I try doing All or Allexcept it doesn't account for my year slicer.

 

 

 

Gross Sales (GL) = SUMX(FILTER('Gross To Net','Gross To Net'[Transaction Type]="Gross Sales"),'Gross To Net'[GL_POSTING_BASE_BALANCE])

 

 

 

 

  • Tuan add a measure 

     

    Trade Expense % = 
    DIVIDE (
     CALCULATE ( SUM ( Table[Amount] ), Table[Transaction Type] = "Trade Expense" ),
     CALCULATE ( SUM ( Table[Amount] ), Table[Transaction Type] = "Gross Sales )
    )
    

     

    and change this measure format to %, you can make the changes to the above expression to meet your business needs.

     

    I would  Kudos if my solution helped. 👉 If you can spend time posting the question, you can also make efforts to give Kudos whoever helped to solve your problem. It is a token of appreciation!

     

4 Replies

  • mahoneypat's avatar
    mahoneypat
    Microsoft Employee

    A sample of your data (or mock data), along with the desired output would help you get a solution to your scenario.

     

    Regards,

    Pat

  • Tuan , Not sure this is what you need. But in Matrix, you can right click on value under visualization tab and choose % of row total

     

    • Tuan's avatar
      Tuan
      Helper III

      Not quite. I want % of another row value.

       

      Maybe this picture will help. I want the Trade Expense to be a % of Gross Sales.

       

      • parry2k's avatar
        parry2k
        Super User

        Tuan add a measure 

         

        Trade Expense % = 
        DIVIDE (
         CALCULATE ( SUM ( Table[Amount] ), Table[Transaction Type] = "Trade Expense" ),
         CALCULATE ( SUM ( Table[Amount] ), Table[Transaction Type] = "Gross Sales )
        )
        

         

        and change this measure format to %, you can make the changes to the above expression to meet your business needs.

         

        I would  Kudos if my solution helped. 👉 If you can spend time posting the question, you can also make efforts to give Kudos whoever helped to solve your problem. It is a token of appreciation!