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

Get certified in Microsoft Fabric—for free! For a limited time, get a free DP-600 exam voucher to use by the end of 2024. Register now

Reply
sgross
Helper I
Helper I

Custom Concatenated Column: A + B, but also just A, if no value is provided for B

I'm trying to concatenate a [Full Title] column, combining values from a [Title] column and a [Subtitle] column. That bit seems pretty easy; "= [Title] & " " & [Subtitle]"

 

But some of the books don't have subtitles, so the concatenated column throws up a null.

 

How can I get the column to display the information it does have, even when the second value is missing?

1 ACCEPTED SOLUTION

I resolved the issue using Column From Examples to create a combined column 🙂

 

Thanks for the help!

View solution in original post

5 REPLIES 5
MFelix
Super User
Super User

Hi @sgross,

 

Use this formula

 

= [Title] & " " & IF(ISBLANK(T[Subtitle]),"",[Subtitle])

 

Regards,

MFelix


Regards

Miguel Félix


Did I answer your question? Mark my post as a solution!

Proud to be a Super User!

Check out my blog: Power BI em Português



Hmm... Using that exact forumula I'm receiving an Expression Error:

Expression.Error: The name 'IF' wasn't recognized.  Make sure it's spelled correctly.

Are you in the power query view? If so the formula needs to be

if...then....else

Regards

Regards

Miguel Félix


Did I answer your question? Mark my post as a solution!

Proud to be a Super User!

Check out my blog: Power BI em Português



I'm sorry, I don't understand what you mean. Here's a screenshot of what I'm looking at right now in the Query Editor:

 

BI Screenshot.png

I resolved the issue using Column From Examples to create a combined column 🙂

 

Thanks for the help!

Helpful resources

Announcements
November Carousel

Fabric Community Update - November 2024

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

Live Sessions with Fabric DB

Be one of the first to start using Fabric Databases

Starting December 3, join live sessions with database experts and the Fabric product team to learn just how easy it is to get started.

Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Early Bird pricing ends December 9th.

Nov PBI Update Carousel

Power BI Monthly Update - November 2024

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