Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
2 years ago
Solved

Calculate percentage issue

Having trouble with my calculation of percentage. 

 

Table contains the Acct codes with Amount. Following measure is for calculating the % of puchase amount ( Acct code = 1000) on each accounts .  

Basically, dividing the transaction amount of each account codes  by the transaction amount with acct code = "1000" 

 

Total Purch = calculate(sum('Transaction'[Amount]),'Transaction'[Acct Code]="1000")
% of Purch = DIVIDE ( SUM('Transaction'[Amount]),[Total Purch], 0)
 
Calculation does show the % as below, but i want to exclude the acct Code - 1000 and show the rest. But when i use the filter the calculation returns 0 

I tried using ALL , but did not work. Attaching the pbix. Expected results is above, but need to exclude 1000 and show the rest of 3 acct codes. 

 

https://drive.google.com/file/d/1z5bzSReY4-hJpn5FdFiHEvUj6sPn4oOs/view?usp=sharing

 

 

 
 
 
 
 
 
  • Anonymous , try like

     

    % of Purch = DIVIDE ( calculate(SUM('Transaction'[Amount]),filter('Transaction', 'Transaction'[Acct Code]<> "1000")),[Total Purch], blank() )

     

     

2 Replies

  • Anonymous , try like

     

    % of Purch = DIVIDE ( calculate(SUM('Transaction'[Amount]),filter('Transaction', 'Transaction'[Acct Code]<> "1000")),[Total Purch], blank() )