Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.
Hi all,
I am trying to calculate the % in a matrix table.
This is my model:
- Survey Data [Table Name - Survey Results] which also specify the location someone works in e.g. Michigan, San Francisco and New York
- [Table Name - Employee Listing] A full listing of employees each with their location
I have managed to work out the overall completion rate by using two COUNTROWs functions to count both rows and then to divide. So in this case, the overall completion rate would be:
13.78% completion rate
I want to work out the % completion rate in a matrix and am not entirely sure how to do that with each location.
For example:
Location | Survey Responses | % Completion within Location |
New York (50 employees) | 31 | 62% |
San Francisco (75 employees) | 34 | 45% |
Michigan (1000 employees) | 90 | 9% |
Thanks in advance
Solved! Go to Solution.
Hi, @Anonymous
According to your description, you want to work out the % completion rate in a matrix grouped by location, you can follow my steps:
This is my test data:
Survey Responses =
COUNT(Response[Response ID])
% Completion within Location =
var _Employee=COUNT(Employee[Employee ID])
var _percent=DIVIDE([Survey Responses],_Employee)
return FORMAT(_percent,"Percent")
overall completion rate =
var _response=COUNTX(ALLSELECTED(Response),[Response ID])
var _employee=COUNTX(ALLSELECTED(Employee),[Employee ID])
return
FORMAT(DIVIDE(_response,_employee),"Percent")
Then create a Matrix and place columns like this, and you can also create a card chart to show the value of the overall completion rate:
And you can get what you want.
You can download my test pbix file here
Best Regards,
Community Support Team _Robert Qin
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi, @Anonymous
According to your description, you want to work out the % completion rate in a matrix grouped by location, you can follow my steps:
This is my test data:
Survey Responses =
COUNT(Response[Response ID])
% Completion within Location =
var _Employee=COUNT(Employee[Employee ID])
var _percent=DIVIDE([Survey Responses],_Employee)
return FORMAT(_percent,"Percent")
overall completion rate =
var _response=COUNTX(ALLSELECTED(Response),[Response ID])
var _employee=COUNTX(ALLSELECTED(Employee),[Employee ID])
return
FORMAT(DIVIDE(_response,_employee),"Percent")
Then create a Matrix and place columns like this, and you can also create a card chart to show the value of the overall completion rate:
And you can get what you want.
You can download my test pbix file here
Best Regards,
Community Support Team _Robert Qin
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
@Anonymous ,Can you share sample data and sample output in table format? Or a sample pbix after removing sensitive data.
Thanks for your help. These are what the tables look like:
Survey responses:
Obviously, there are more lines but I hope you get the gist
Sorry photos didnt come through for some reason this is what I was hoping:
These are two separate queries, obviously, the location names would be different.
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
118 | |
104 | |
77 | |
73 | |
52 |
User | Count |
---|---|
145 | |
109 | |
109 | |
90 | |
64 |