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
Borjaveigasvh
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
Smauro
Solution Sage
Solution Sage

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
Smauro
Solution Sage
Solution Sage

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

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.

Top Solution Authors
Top Kudoed Authors