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

Grow your Fabric skills and prepare for the DP-600 certification exam by completing the latest Microsoft Fabric challenge.

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
RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

Ask questions in Eventhouse and KQL, Eventstream, and Reflex.

MayPowerBICarousel

Power BI Monthly Update - May 2024

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