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
Anonymous
Not applicable

create new column by using existing value by giving group by values

Hi Commnity..!!

Please refer below images,

PatilPrasad027_0-1717764524617.png

I have this above data , i have more than 100 rows of data, i have added only few rows in the above pic.

Here is my requirement,

I want to create a new column which groups facebook related fields in single row and remaining in single row,

Ex : 

PatilPrasad027_1-1717765109334.png

I want to create new column as Name2

Could anyone please help me out to get the required output.

Thanks in advance..!!

1 ACCEPTED SOLUTION
jgeddes
Super User
Super User

A calculated column with the following code might work for you...

Name2 = 
IF(
CONTAINSSTRING([Name1], "Facebook"),
"Facebook",
[Name1]
)

If you end up needing to group more rows then you may need to explore using a SWITCH() statement.





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!





View solution in original post

2 REPLIES 2
Anonymous
Not applicable

Thank you so much for the quick responce..!! @jgeddes 

jgeddes
Super User
Super User

A calculated column with the following code might work for you...

Name2 = 
IF(
CONTAINSSTRING([Name1], "Facebook"),
"Facebook",
[Name1]
)

If you end up needing to group more rows then you may need to explore using a SWITCH() statement.





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!





Helpful resources

Announcements
July 2025 community update carousel

Fabric Community Update - July 2025

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

July PBI25 Carousel

Power BI Monthly Update - July 2025

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