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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
ritanoori
Resolver I
Resolver I

Need help in a custom column

Hello everyone 

 

I'm trying to create two custom columns in power query and I'm trying to merge the two steps into one can you help pls. 

 

First col: 

SPN= if(
[System]) = "IC" then [GltDescription] else

if([IcItem]) is null then [Item] else

if([Item]) is null then [IcItem] else [Item]

 

Second col: 

SPN2= if(
Text.Contains[SPN]) ="AUTO" then "" else [SPN])

 

How can I put the two in one custom col please. 

Thanks 

Rita

 

1 ACCEPTED SOLUTION
v-janeyg-msft
Community Support
Community Support

Hi, @ritanoori 

 

You can try like this:

let SPN = if(
[System]) = "IC" then [GltDescription] else
if([IcItem]) is null then [Item] else
if([Item]) is null then [IcItem] else [Item]
in if
Text.Contains(SPN,"AUTO") then "" else SPN

v-janeyg-msft_0-1612851988014.jpeg

Best Regards

Janey Guo

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

2 REPLIES 2
v-janeyg-msft
Community Support
Community Support

Hi, @ritanoori 

 

You can try like this:

let SPN = if(
[System]) = "IC" then [GltDescription] else
if([IcItem]) is null then [Item] else
if([Item]) is null then [IcItem] else [Item]
in if
Text.Contains(SPN,"AUTO") then "" else SPN

v-janeyg-msft_0-1612851988014.jpeg

Best Regards

Janey Guo

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

amitchandak
Super User
Super User

@ritanoori , Actually then depend on where you want it. because they are mutually exclusive.

 

What is the final output you want.

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

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