Divide two distinct count columns from 2 different tables

Justplainj

Board Regular
Joined
Apr 15, 2021
Messages
50
Office Version
  1. 365
Platform
  1. Windows
Good day All,

I am trying to create a measure by dividing two columns (each from seperate tables).
Below is the DAX function I am using.

Trained Headcount = DISTINCTCOUNT('Training Data'[Identity Number])/COUNT(ConsEmployeeDetails[Emp Number])

The distinct count should count the amount of IDs of trained employees on the training data table. The count, counts the employee numbers on the main employee data sheet.
When I apply the functions separately it gives the correct numbers (1074 trained employees vs 1453 total employees) but using the above measure results in 100% instead of 73.91% which is 1074/1453.

What am I doing wrong?

Thanks
J
 

Excel Facts

Last used cell?
Press Ctrl+End to move to what Excel thinks is the last used cell.
Hi All

I got this resolved by doing the following. If there is alternate or easier way. Please post below.

I created a measure within the Employees table to do a DISTINCTCOUNT of the employee number to get the total headcount (you can also use count as the employee numbers should not be duplicate.
I then also created a measure of DISTINCTCOUNT of the employee number in the training data table (DISTINCT is used as some employees received training more than once.

I then created a third measure (this was placed in the training data table) that uses the DIVIDE function to divide the previously created measures.

This divides the first count measure to the other to give the correct answer.

Thanks.
J
 
Upvote 0
Solution

Forum statistics

Threads
1,224,823
Messages
6,181,169
Members
453,021
Latest member
Justyna P

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top