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

Get inspired! Check out the entries from the Power BI DataViz World Championships preliminary rounds and give kudos to your favorites. View the vizzies.

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])))
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]))

 

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 

 

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])))
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])))
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]))

Full Power BI Video 20 Hours YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code FABINSIDER for a $400 discount!

FebPBI_Carousel

Power BI Monthly Update - February 2025

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

March2025 Carousel

Fabric Community Update - March 2025

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