cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Regular Visitor

Concatenate result if condition is met

Good Morning to all,

 

I am trying to create a conditional column, when one of the columns is null, I would like to create a value in each row that is the concatenated of an other column & 00000

else I would like the column to be as the initial

 

I wrote it like this :

= Table.AddColumn(#"Duplicados quitados", "CUSEC2", each if [CUSEC] = " " then Text.PadEnd([CM_FISCAL],9,"0")else [CUSEC])

 

But the result got eas not as I expected, I' obtaining exactly the value that appears at [CUSEC] but the nulls keep being nulls

 

Would Appreciate any help with t

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
Solution Supplier
Solution Supplier

Re: Concatenate result if condition is met

Hi @Borjaveigasvh

By [CUSEC] = " " you're not checking for nulls though, you should use [CUSEC] = null. Also, if [CM_FISCAL] is null then Text.PadEnd will result in null as well



Feel free to connect with me:
LinkedIn

View solution in original post

1 REPLY 1
Highlighted
Solution Supplier
Solution Supplier

Re: Concatenate result if condition is met

Hi @Borjaveigasvh

By [CUSEC] = " " you're not checking for nulls though, you should use [CUSEC] = null. Also, if [CM_FISCAL] is null then Text.PadEnd will result in null as well



Feel free to connect with me:
LinkedIn

View solution in original post

Helpful resources

Announcements
August 2020 Community Challenge: Can You Solve These?

August 2020 Community Challenge: Can You Solve These?

We're excited to announce our first cross-community 'Can You Solve These?' challenge!

July 2020 Community Highlights

July 2020 Community Highlights

Learn about the exciting things that happened in July.

Upcoming Events

Upcoming Events

Wondering what events you could join or have an event to promote yourself? Check out our Upcoming Events.

Get Ready for Power BI Dev Camp

Get Ready for Power BI Dev Camp

We are thrilled to announce we will begin running a monthly webinar series named Power BI Dev Camp.

Top Solution Authors