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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
Anonymous
Not applicable

Change and output string value in a table

Hi all,

 

Is there away to trim or change a string from an array and only output particular terms.

 

For example, from the table below, I only want to output the string values of 'Owners' and 'Members' and remove everything else outside of the membership column. Positional wise they will always be at the end.

Current Table

GroupMembership
RedRed 1 Owners
RedRed 2 Owners
RedRed Members
BlueBlue Members
BlueBlue 1 Owners
BlueBlue 1234567 Owners
BlueAccess Type 12345 Owners

 

Expectation if possible:

GroupMembership
RedOwners
RedOwners
RedMembers
BlueMembers
BlueOwners
BlueOwners
BlueOwners

 

4 REPLIES 4
Ajendra
Resolver I
Resolver I

Hey,

 

Try this one!

 

1.JPG

Anonymous
Not applicable

Thanks Ajendra, Struggling abit with the walk through.

 

So copy and renamed the table, in your example to "Help Column"
When I add the second line it's not autopopulating?

LaML415_0-1684445122428.png

Cheers!



hi @Anonymous 

the suggested solutions are DAX code and supposed to add calculated columns, instead of custom column in Power Query. 

Jihwan_Kim
Super User
Super User

Hi,

The below is one of many solutions to create a new table.

Please check the below picture and the attached pbix file.

 

 

Jihwan_Kim_0-1684421381855.png

 

 

Create New Table =
SELECTCOLUMNS (
    ADDCOLUMNS (
        Data,
        "@MembershipNew",
            SWITCH (
                TRUE (),
                CONTAINSSTRING ( Data[Membership], "Owners" ), "Owners",
                CONTAINSSTRING ( Data[Membership], "Members" ), "Members"
            )
    ),
    "@Group", Data[Group],
    "@Membership", [@MembershipNew]
)

 


If this post helps, then please consider accepting it as the solution to help other members find it faster, and give a big thumbs up.


Click here to visit my LinkedIn page

Click here to schedule a short Teams meeting to discuss your question.

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

November Power BI Update Carousel

Power BI Monthly Update - November 2025

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

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.