Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
6 years ago

Assignment of rows

Hi

 

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,

Katie 

3 Replies

  • Anonymous ,

    compare these two

     

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

  • v-xicai's avatar
    v-xicai
    Icon for Community Support rankCommunity Support

    Hi Anonymous ,

     

    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,

    Amy 

     

    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.

    • Anonymous's avatar
      Anonymous
      Not applicable

      Hi,

       

      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,

      Katie