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

Get certified in Microsoft Fabric—for free! For a limited time, the Microsoft Fabric Community team will be offering free DP-600 exam vouchers. Prepare now

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
OCT PBI Update Carousel

Power BI Monthly Update - October 2024

Check out the October 2024 Power BI update to learn about new features.

September Hackathon Carousel

Microsoft Fabric & AI Learning Hackathon

Learn from experts, get hands-on experience, and win awesome prizes.

October NL Carousel

Fabric Community Update - October 2024

Find out what's new and trending in the Fabric Community.