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

July 7 - July 17 | Round 2 of the Power BI Dataviz World Championships. Don't miss your chance! Learn more

Reply
athomp15
Helper I
Helper I

Append to string based on number (loop)

Hi, 

 

Any help would be appreciated. 

I have a source table that shows allocated resources on a project. I would like to add a new column which appends to the "Resource Allocated" column ";Another" for each resource we have missing.

Source Table

Resources Allocated,Number Required,Resources Missing

Person1;Person2,3,1

Person2;Person4,2,0

Person3,3,2

 

Target

Resources Allocated, Number Required,Resources Missing,Resources Resource Allocated Ammended

Person1;Person2,3,1,Person1;Person2;Another

Person2;Person4,2,0,Person2;Person4

Person3,3,2,Person3;Another;Another

 

Thanks

Alex

1 ACCEPTED SOLUTION
AlexisOlson
Super User
Super User

You can do this with a custom column that repeats ";Another" according to the missing amount:

 

[Resources Allocated] & Text.Repeat(";Another", [Resources Missing])

 

View solution in original post

3 REPLIES 3
NSRjecross
Frequent Visitor

@athomp15 

I think the problem here is the original table design isn't designed for this type of reporting.

you should have a  project table that lists the project and the number of resources required.

Then a resource table with your resource items (apparently people)

Then you make a project-resource table with a record for each resource allocated to a project.

 

Then the operation you are after becomes joins with counts or pivots depending what you want.

At the moment you are having to unpack and repack your resource lists for allocated to get counts, who etc.

You can also add some dates to the various tables if you want to have project scheduling with intermittent allocation rather than have to assign a resource to the entire project timeline. 

Good luck

Jen

v-juanli-msft
Community Support
Community Support

Hi @athomp15 

If AlexisOlson slove your problem, could you kindly accept this as a solution?

If not, please let me know how to get target table from your original table?

 

Capture7.JPG

Best Regards
Maggie
Community Support Team _ Maggie Li
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

AlexisOlson
Super User
Super User

You can do this with a custom column that repeats ";Another" according to the missing amount:

 

[Resources Allocated] & Text.Repeat(";Another", [Resources Missing])

 

Helpful resources

Announcements
FabCon and SQLCon Barcelona 2026

FabCon & SQLCon – Barcelona 2026

Join us in Barcelona for FabCon and SQLCon, the Fabric, Power BI, SQL, and AI community event. Save €200 with code FABCMTY200.

60 days of Data Days Carousel

Data Days 2026

Join Data Days 2026: 60 days of free live/on-demand sessions, challenges, study groups, and certification opportunities.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.

Top Solution Authors