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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

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
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

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

April Fabric Community Update

Fabric Community Update - April 2024

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