Forum Discussion
MeganMarkey
1 year agoRegular Visitor
Concatenate EXCEPT where blank
Hey everyone! I have 2 columns which I'm trying to concatenate with a "/" - However, in some instances, the 'Tr.prt' column is blank. Where this occurs, I don't want the concatenation to happen a...
- 1 year ago
Good day MeganMarkey,
It may be that the solutions given do not work for as they are DAX solutions and you may be working in Power Query. As you posted in the Power Query forum I'll give you a Power Query solution. Add a custom column using the following code,
= if [Tr.prt] = "" then "" else [CoCd] & "/" & [Tr.prt]
Hope this helps
Riny_vE
Helper I
1 year agoWouldn't this work?
Relationship = IF(LEN(TRIM(GIT[Tr.Prt]))=0,BLANK(),GIT[CoCd]&"/"&GIT[Tr.Prt])
- v-veshwara-msft1 year ago
Community Support
Hi Riny_vE ,
Thanks for the suggestion.
Yes, the expression you provided works well as a calculated column when used within the same table:
Relationship = IF(LEN(TRIM([Tr.prt])) = 0, BLANK(), [CoCd] & "/" & [Tr.prt])
I tested this in the sample file and it gives the expected output, handling both blank and whitespace-only values in Tr.prt.Appreciate your input.