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

Earn the coveted Fabric Analytics Engineer certification. 100% off your exam for a limited time only!

Reply
MitaSaxena
Frequent Visitor

Percentage calculation for hierarchical data

Hi All,

I am stuck with my power bi report & wondered if someone knows how to do this? I am trying to calculate turnover % - the hierarchical data is by department, team and location - I can create a matrix table with department, team, and location and able to have correct sum data for leavers and count of staff, but cannot workout how to calculate the % for each level - It adds all percentages from lower hierarchies.... has anyone come across this at all? Thanks in advance 🙂

 
Row LabelsSum of LeaversSum of Staff Numbers% As should beIn Power BI
Dept 1115919%91%
Team A73123%63%
Location 121020%20%
Location 241527%27%
Location 31617%17%
Team B42814%28%
Location 11813%13%
Location 232015%15%

 

1 ACCEPTED SOLUTION
v-yangliu-msft
Community Support
Community Support

Hi  @MitaSaxena  ,

According to your description, I create this data:

v-yangliu-msft_0-1611285981605.png

Here are the steps you can follow:

1. Create measure.

% As should be =
DIVIDE(SUM('Table'[Leavers]),SUM('Table'[Staff Number]))

2. Result

v-yangliu-msft_1-1611285981613.png

 

You can downloaded PBIX file from here.

 

Best Regards,

Liu Yang

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

3 REPLIES 3
MitaSaxena
Frequent Visitor

Thank you so much, it would make such a big difference. I am surprised that exactly same formula does not work as a column, but does as a measure. Will need to learn more about this. Thanks again.

v-yangliu-msft
Community Support
Community Support

Hi  @MitaSaxena  ,

According to your description, I create this data:

v-yangliu-msft_0-1611285981605.png

Here are the steps you can follow:

1. Create measure.

% As should be =
DIVIDE(SUM('Table'[Leavers]),SUM('Table'[Staff Number]))

2. Result

v-yangliu-msft_1-1611285981613.png

 

You can downloaded PBIX file from here.

 

Best Regards,

Liu Yang

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

lbendlin
Super User
Super User

At the very minimum you need to add a column to your data that indicates the hierarchy level for each row.  Then you can filter by that level as needed.

Helpful resources

Announcements
April AMA free

Microsoft Fabric AMA Livestream

Join us Tuesday, April 09, 9:00 – 10:00 AM PST for a live, expert-led Q&A session on all things Microsoft Fabric!

March Fabric Community Update

Fabric Community Update - March 2024

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