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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply
thampton
Helper III
Helper III

Dynamic assignments based on count of a value

Hello! Hopefully there is an answer for this one as im not too sure. 

 

I have 2 tables i will be working with: 

 

COUNT BY GROUP:

Group         Count

Group 1      75

Group 2      50

Group 3      75

Group 4      25

 

Shift Assignment

Employee          Employee #            Backup Employee #      Shift

Jane                   1                             3                                   1

John                   2                            1                                   1

Sarah                 3                            2                                    1

 

Backup employee is saying, If Sarah is gone, Jane will be her back. 

 

Is there a way i can create a measure that will map assignments to employees based on total count? So expected outcome would like what is below. I would also like to put a MAX of 150 on assigned count. 

 

OUTPUT

Employee          Employee #            Backup Employee #      Shift     Group Assignment

Jane                   1                             3                                   1           2 & 4

John                   2                            1                                   1           1

Sarah                 3                            2                                    1           3

 

Or we could go the other way showing 

 

Group         Count    Assignee

Group 1      75          John

Group 2      50         Jane

Group 3      75         Sarah

Group 4      25         Jane

 

 

Thanks in Advance!

 

 

3 REPLIES 3
Greg_Deckler
Community Champion
Community Champion

What are the rules around assigning employees to Groups? Why does John go to Group 1?



Follow on LinkedIn
@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
DAX For Humans

DAX is easy, CALCULATE makes DAX hard...

I would like to have each person with a relatively similar count. Because the distribution would not be even every time like it is here, it would just need to divide up as evenly as possible. If that doesnt make sense let me know. 

Makes sense, but I think that is going to be extremely difficult to do quite frankly. Seems like you would need something that could iterate over things and figure that out, but that' definitely not a strength of DAX. DAX does not like looping or anything similar. So, does the "Count" column represent a % or is it just some relative measure of how much time it takes? So, is 75 saying that it would take 75% of someone's time?

 

Interesting issue but, again, probably not really something very well suited for Power BI. Power BI is for analyzing data, not really about automating/implementing business processes really and that's really what this sounds like to me, automating scheduling decisions.



Follow on LinkedIn
@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
DAX For Humans

DAX is easy, CALCULATE makes DAX hard...

Helpful resources

Announcements
July PBI25 Carousel

Power BI Monthly Update - July 2025

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

Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 community update carousel

Fabric Community Update - June 2025

Find out what's new and trending in the Fabric community.