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

Learn from the best! Meet the four finalists headed to the FINALS of the Power BI Dataviz World Championships! Register now

Reply
PBI_newuser
Post Prodigy
Post Prodigy

How to calculate the proportion of a staff

Hi,

How to get the proportion of a staff with the below raw data.

Expected Output:

StaffProportion
Alan1
Amelia1/9
Amy1
Ben1/4
Bernard1/5
Bob1/4
Clark1/8

 

Raw Data:

StaffProduct 
AmySYS
AlanSYS
AmeliaBT
AmeliaD
AmeliaEPC
AmeliaMDI
AmeliaGIT
AmeliaPHX
AmeliaAP
AmeliaPHM
AmeliaVRT
BenFP
BenPS
BenTMP
BenTSP
BobFP
BobPS
BobTMP
BobTSP
BernardIO
BernardSYS
BernardTLA
BernardUCA
BernardWCA
ClarkBT
ClarkF
ClarkEPC
ClarkMDI
ClarkAP
ClarkAP
ClarkPHM
ClarkVRT
1 ACCEPTED SOLUTION

@PBI_newuser , Please find the file after signature

Staff Contribution = SUMX(VALUES('Table'[Staff]),CALCULATE(divide(distinctcount('Table'[Staff]),distinctcount('Table'[Product])),ALLEXCEPT('Table','Table'[Staff])))
Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

View solution in original post

10 REPLIES 10
PBI_newuser
Post Prodigy
Post Prodigy

Hi @amitchandak , thanks! after getting the contribution of staff, how can I get the total contribution per product?

Expected Output:

ProductContribution
AP1/9+1/8
BT1/9+1/8
D1/9
EPC1/9+1/8
F1/8
GIT1/9
IO1/5
MDI1/9+1/8
PHM1/9+1/8
PHX1/9
PS1/4+1/4
SYS1+1+1/5
TLA1/5
TMP1/4+1/4
TSP1/4+1/4
UCA1/5
VRT1/9+1/8
WCA1/5

@PBI_newuser , Try count below

divide(distinctcount(Table[Staff]),count(Table[Product]))

 

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

Hi @amitchandak, I would like to calculate the total contribution per product as shown in the screenshot below. Sample here.

 

PBI_newuser_1-1612759958028.png

 

@PBI_newuser , Please find the attached pbix and see if that can help 

 

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

Hi @amitchandak , I understand the measure you created. But I would like to create another measure based on the Ratio you have created.

Ratio = DIVIDE(DISTINCTCOUNT('Table'[Staff]), COUNT('Table'[Product]))

For example, Amelia and Clark are under Product AP.

Amelia's ratio is 0.11 while Clark's ratio is  0.13. 

The total ratio for Product AP = 0.11 + 0.13 = 0.24.

How to calculate the total ratio for each product?

@PBI_newuser , Try like

sumx(values('Table'[Staff]),DIVIDE(DISTINCTCOUNT('Table'[Staff]), COUNT('Table'[Product])))
Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

Hi @amitchandak , thanks for your help! But I couldn't get the expected result. 

 

PBI_newuser_0-1612768134504.png

 

@PBI_newuser , Please find the file after signature

Staff Contribution = SUMX(VALUES('Table'[Staff]),CALCULATE(divide(distinctcount('Table'[Staff]),distinctcount('Table'[Product])),ALLEXCEPT('Table','Table'[Staff])))
Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

Hi @amitchandak , it works!! Thank you so much! 😊

amitchandak
Super User
Super User

@PBI_newuser , Create a new measure like

 

divide(distinctcount(Table[Staff]),distinctcount(Table[Product]))

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

Helpful resources

Announcements
Join our Fabric User Panel

Join our Fabric User Panel

Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.

February Power BI Update Carousel

Power BI Monthly Update - February 2026

Check out the February 2026 Power BI update to learn about new features.

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.