Showing results for 
Search instead for 
Did you mean: 
Helper I
Helper I

Assignment of rows



I am looking for a formula that checks how many rows have already been assigned to an employee for example, if an employee has more than the a average of the rest of the employees, then flag. I would want the amount of rows that they have been over assigned to be reassigned back to the rest of the employees so everyone has in and around the same amount of rows. 


Kind regards,


Community Support
Community Support

Hi @kitoh1 ,


You may create measure like DAX below.


CountFlag= COUNTX(SUMMARIZE(ALLSELECTED(Table1),Table1[employee],"_flag", IF( MAX( Table1[Employee Value])> AVERAGE( Table1[Employee Value]),"flag") ), [_flag] )


If I misunderstood it, could you please share your sample data and desired output screenshots for further analysis? You can also upload sample pbix to OneDrive and post the link here. Do mask sensitive data before uploading.


Please read this post to get your answer quickly: How to Get Your Question Answered Quickly


Best Regards,



Community Support Team _ Amy

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.



Thanks you so much for getting back to me on this as


I have wrote the logic out in the attached file, let me know if it is not clear.


What I have is in green, & what I need is highlighted in red


Doc IDCountry 1Assigned to column Count of workflowsReassignFinal count of workflows
 Divide doc ID's that are from country 1 between 2 employees Reassign all other Doc ID's equally between other employees but also assign some of these to Country 1 employees (Using the RAND BETWEEN function to assign)Count of occurancesI need a column to identify that that Employee A has gotten too many Doc ID's and to take away some of the Doc ID's from them and reassign them back to Employee B & C so that all employees have a similar amount of Doc IDs. (It is okay if not a even split as RAND BETWEEN function does not give this)Count of occurances
1 Employee B4Employee B5
2Employee AEmployee A8Employee A5
3 Employee B4Employee B5
4 Employee C3Employee C5
5 Employee A8Employee B5
6 Employee A8Employee A5
7Employee AEmployee A8Employee A5
8 Employee B4Employee B5
9 Employee C3Employee C5
10 Employee C3Employee C5
11 Employee A8Employee C5
12Employee AEmployee A8Employee A5
13 Employee B4Employee B5
14 Employee A8Employee C5
15Employee AEmployee A8Employee A5


Kind regards,


Super User IV
Super User IV

@kitoh1 ,

compare these two


countrows(table)  and averageX(summarize(all(table),table[emp],"_1",countrows(Table)),[_1])

Did I answer your question? Mark my post as a solution! Appreciate your Kudos!!
Dashboard of My Blogs !! YouTube Channel !! Connect on Linkedin

Proud to be a Super User!

Helpful resources



We are excited to announce the Power BI Super Users!

Wave Release 2

Check out the updates in Power BI.

Overview of Power BI 2020 release wave 2!

Microsoft Ignite

Microsoft Ignite

Join digitally, March 2–4, 2021 to explore new tech that's ready to implement. Experience the keynote in mixed reality through AltspaceVR!


The largest Power BI virtual conference

100+ sessions, 100+ speakers, Product managers, MVPs, and experts. All about Power BI. Attend online or watch the recordings.

Top Solution Authors
Top Kudoed Authors