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
acg
Resolver I
Resolver I

Create a new column with selected variables of another column

I have a column that has different phone numbers plus the names of known  contacts. 

I want only keep  the names of known  contacts and any phone number starting with the country code 61- the rest should be null. 

 

I have duplicated a column in the Transform Data Editor. 

How do I customase the column in Custom Column?  That is everything except the names of known  contacts and any phone number starting with the country code 61 should be set NULL. 

I am aware that I can use filter options, but due to the sheer number of phone numbers, I do want a code to automate it.

 

Does anyone know where to look that up? I am thinking I essentially I need something like  a 'case when ' clause saying 

case when [Number] in ('Peter', Frank') or 

        when (LEFT ([Number] ,2) = '61'  then [Number] else null end as [Number_edited]

 

But it might be easier to just resolve this in sql - but just curious. 

1 ACCEPTED SOLUTION
amitchandak
Super User
Super User

@acg , A new column like

 

Number_edited =
Switch( True(),
[Number] in {"Peter", "Frank"} || LEFT ([Number] ,2) = "61" ,[Number]
Blank()
)

 

 

A column can not take selected value in slicer or filter of another column

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

View solution in original post

1 REPLY 1
amitchandak
Super User
Super User

@acg , A new column like

 

Number_edited =
Switch( True(),
[Number] in {"Peter", "Frank"} || LEFT ([Number] ,2) = "61" ,[Number]
Blank()
)

 

 

A column can not take selected value in slicer or filter of another column

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

Helpful resources

Announcements
November Power BI Update Carousel

Power BI Monthly Update - November 2025

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

Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

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.