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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now

Reply
jadewind
Advocate I
Advocate I

Calculate rate from two tables

Hi all,

 

I'm new to Power BI. I have got a few tables in Power BI and try to link them correctly and do some basic routine calculations. 

 

Now I have two tables, one lists Incidents data and another lists Number of staff data. Both of them have fields like Region, Cost Centre, Financial Year etc. I also have a third table that contains cost centre hierarchy if needed, to link these two tables by cost centre codes. 

 

In Incidents data, I can count how many incidents by Region by Financial Year. In staff data, I can count how many staff by Region by Financial Year.

 

Now I need to calculate the incident rate = No. of Incidents / Number of Staff. 

 

I need to also be able to break down the incident rate by Region, Cost Centre etc AND by Financial Year. 

 

I find the rates I get are not correct. My DAX is "

Incident Rate = COUNTA(Incidents[Incident No.]) / SUM(Staffs[Total]) * DISTINCTCOUNT(Staff[Report Date])

"

 

How should I do it to make it work?

 

Thanks in advance for any help!

1 ACCEPTED SOLUTION
v-sihou-msft
Microsoft Employee
Microsoft Employee

@jadewind

 

In this scenario, since both table contains Region, Cost Centre, Financial Year fields, you suppose already built the relationship between two tables. To calcualte the rate, you just need to use ALLEXCEPT() to have your calculation group on corresponding fields to get correct result.

 

Incident Rate =CALCULATE(COUNTA(Incidents[Incident No.]),ALLEXCEPT(Incidents,Incidents[Region],Incidents[Cost Centre],Incidents[Financial Year])) /

(CALCULATE(SUM(Staffs[Total]), ALLEXCEPT(Staffs,Staffs[Region]),Staffs[Cost Centre],Staffs[Financial Year]))

*

CALCULATE(DISTINCTCOUNT(Staff[Report Date]),ALLEXCEPT(Staffs,Staffs[Region]),Staffs[Cost Centre],Staffs[Financial Year])))

 

Regards,

View solution in original post

1 REPLY 1
v-sihou-msft
Microsoft Employee
Microsoft Employee

@jadewind

 

In this scenario, since both table contains Region, Cost Centre, Financial Year fields, you suppose already built the relationship between two tables. To calcualte the rate, you just need to use ALLEXCEPT() to have your calculation group on corresponding fields to get correct result.

 

Incident Rate =CALCULATE(COUNTA(Incidents[Incident No.]),ALLEXCEPT(Incidents,Incidents[Region],Incidents[Cost Centre],Incidents[Financial Year])) /

(CALCULATE(SUM(Staffs[Total]), ALLEXCEPT(Staffs,Staffs[Region]),Staffs[Cost Centre],Staffs[Financial Year]))

*

CALCULATE(DISTINCTCOUNT(Staff[Report Date]),ALLEXCEPT(Staffs,Staffs[Region]),Staffs[Cost Centre],Staffs[Financial Year])))

 

Regards,

Helpful resources

Announcements
November Power BI Update Carousel

Power BI Monthly Update - November 2025

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

Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

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.

Top Solution Authors