Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

The Power BI DataViz World Championships are on! With four chances to enter, you could win a spot in the LIVE Grand Finale in Las Vegas. Show off your skills.

Reply
BQIAN
Regular Visitor

create measure to calculate % of total and allocation

Guys can anyone help please.

I have made a simple example to show what I am trying to achieve. Table 1 has cost in cost centre A where it is posted to and table B has usage/allocaiton key, both tables are separate queires uploaded into Power BI. Tabel 3 is a visual (table visual) I would like to achieve and I have tried to create 2 measures using SELECTALL to create TOTAL measure first and then DIVIDE to do the % but for some reasons when I add the new measure to new column it still breaks down by individual cost centre and hence % for each cost centre becomes 100%. Can anyone help me out please?

 

Source tables:

 

Table A

Cost Centre$
Cost Centre A1000

 

Table B

Cost CentreAllocation Key
Cost Centre B500
Cost Centre C300
Cost Centre D200
Cost Centre E50

 

Table Visual

 

Cost CentreAllocation KeyTotal%Allocation
Cost Centre B500105048%                     476
Cost Centre C300105029%                     286
Cost Centre D200105019%                     190
Cost Centre E5010505%                       48
Total10501050100%                 1,000
1 ACCEPTED SOLUTION
v-lili6-msft
Community Support
Community Support

HI, @BQIAN

After my research, you could try these formulas as below:

Total = CALCULATE(SUM(TableB[Allocation Key]),ALLSELECTED(TableB))

% = DIVIDE(CALCULATE(SUM(TableB[Allocation Key])),[Total])

Allocation = CALCULATE(SUM(TableA[$]))*[%]

Result:

3.JPG

 

 

Best Regards,

Lin

 

Community Support Team _ Lin
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

1 REPLY 1
v-lili6-msft
Community Support
Community Support

HI, @BQIAN

After my research, you could try these formulas as below:

Total = CALCULATE(SUM(TableB[Allocation Key]),ALLSELECTED(TableB))

% = DIVIDE(CALCULATE(SUM(TableB[Allocation Key])),[Total])

Allocation = CALCULATE(SUM(TableA[$]))*[%]

Result:

3.JPG

 

 

Best Regards,

Lin

 

Community Support Team _ Lin
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Helpful resources

Announcements
Feb2025 Sticker Challenge

Join our Community Sticker Challenge 2025

If you love stickers, then you will definitely want to check out our Community Sticker Challenge!