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

Calling all Data Engineers! Fabric Data Engineer (Exam DP-700) live sessions are back! Starting October 16th. Sign up.

Reply
Anonymous
Not applicable

percentage from row total in matrix

Hi there.

 

I created a matrix which looks like pictcure below. My question is how can I calculate % from row grand total for complementary worker and regular wokrer as well directly in matrix.

 

Capture.PNG

My source data looks like this. 

Capture2.PNG

 

Thanks in advance

1 ACCEPTED SOLUTION
Omega
Impactful Individual
Impactful Individual

Try the following measures: 

 

1- Create grand meausre: 

Grand = COUNT('Table'[Employee ID])

2- Create CW%

CW% = 
var x = CALCULATE(COUNT('Table'[Employee ID]),'Table'[Employee Type]="C")
return
DIVIDE(x,[Grand],0)

3- Create RW%

RW% = 
var x = CALCULATE(COUNT('Table'[Employee ID]),'Table'[Employee Type]="R")
return
DIVIDE(x,[Grand])

View solution in original post

5 REPLIES 5
Omega
Impactful Individual
Impactful Individual

Create the below measures: 

 

1- Grand Total

Grant Total = SUM('Table'[CW]) + SUM('Table'[REG])

2- CW %

CW% = DIVIDE(SUM('Table'[CW]),[Grant Total],0)

3- REG%

REG% = DIVIDE(SUM('Table'[REG]),[Grant Total],0)
Anonymous
Not applicable

Thanks for your advice. Problem is that I have CW/Regular employee only in one column with name status (as on second picture in my original post) moreover if I try SUM funtion it won't work with string data type. In other words I need add percentage from total employee by site.

Omega
Impactful Individual
Impactful Individual

I believe your data table looks more like: 

 

Site|Employee ID| Employee Type|Value

A   |123|CW |10 

B   |312|REG|200

C   |414|REG|30

 

Right?

 

Anonymous
Not applicable

Nope, my raw data looks like this: 

 

Employee ID| Site| Employee Type

123| Site A| Regular employee

321| Site B| Complementary employee

456| Site C| Regular employee

654| Site C| Complementary employee

etc.

Please mark there is no value column in my data source, it other words every row is a one concrete employee. In excel there was easy way via pivot table to connect site name with count of employe type and then calulate % from it. I am strugeling to get percentage column of complementary and regular workers from total site employees in power bi.  Please consider my first picture as matrix pattern not data source. 

Omega
Impactful Individual
Impactful Individual

Try the following measures: 

 

1- Create grand meausre: 

Grand = COUNT('Table'[Employee ID])

2- Create CW%

CW% = 
var x = CALCULATE(COUNT('Table'[Employee ID]),'Table'[Employee Type]="C")
return
DIVIDE(x,[Grand],0)

3- Create RW%

RW% = 
var x = CALCULATE(COUNT('Table'[Employee ID]),'Table'[Employee Type]="R")
return
DIVIDE(x,[Grand])

Helpful resources

Announcements
FabCon Global Hackathon Carousel

FabCon Global Hackathon

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

Check out the October 2025 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.