cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
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

Accepted Solutions
Community Support
Community Support

Re: create measure to calculate % of total and allocation

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
Community Support
Community Support

Re: create measure to calculate % of total and allocation

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

Helpful resources

Announcements
‘Better Together’ T-Shirt Contest – Winner Announced!

‘Better Together’ T-Shirt Contest – Winner Announced!

And the winner is...

Announcing the New Spanish Forum

Announcing the New Spanish Forum

Do you need help in Spanish? Check out our new Spanish community section.

April 2020 Community Highlights

April 2020 Community Highlights

Info on our Super Users, MBAS content and badges, and updates to our support articles. - Read the full Community Highlights.

MBAS Gallery 2020

MBAS Gallery 2020

Watch Microsoft Business Applications Summit sessions on-demand.

Top Solution Authors
Top Kudoed Authors