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

Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM. Register now.

Reply
Anonymous
Not applicable

Custom Column: Concatenate Text with multiple IF statements

Hey everyone

 

I am at work and I have to put together some custom columns from my data. I only have basic understanding of the PowerBI languages, any help would be appreciated. 

 

Here is my starting point. I have two columns with three states. The third column VALUE_MODEL is the custom column, the desired results are given in the fields. The "-" acts as a delimiter between the values from the two columns.

 

Screenshot 2022-11-02 170917.png

 

I would compile like this:

 

VALUE_MODEL = if [TOPICS] <> "" and [LOCAL_BUTTONS] = "" then [TOPICS], else if [TOPICS] <> "" and [LOCAL_BUTTONS] <> "" then [TOPICS]"-"[LOCAL_BUTTONS], else if [TOPICS] = "" and [LOCAL_BUTTONS] = "" then "", else null

 

I am running into several errors. The first one is a Token Else expected:

Screenshot 2022-11-02 171709.png

 

Obviously I haven't fully understood the correct syntax here. Any help for a beginner would be highly appreciated. Thank you very much in advance!

1 ACCEPTED SOLUTION
Anonymous
Not applicable

I took my time off after work and sat down to calmly and logically approach the problem and do some reading up on DAX syntax. I found this somewhat elegant solution:

 

RESULT = IF([ONE]<>"null", IF([TWO]<>"null", CONCATENATE([ONE],CONCATENATE("-",[TWO])), [ONE]), [TWO])
 

Screenshot 2022-11-02 215137.png

 

If you have any idea how to make this more concise or beautiful, please let me know. I think I got the basic understanding of DAX syntax now.

View solution in original post

1 REPLY 1
Anonymous
Not applicable

I took my time off after work and sat down to calmly and logically approach the problem and do some reading up on DAX syntax. I found this somewhat elegant solution:

 

RESULT = IF([ONE]<>"null", IF([TWO]<>"null", CONCATENATE([ONE],CONCATENATE("-",[TWO])), [ONE]), [TWO])
 

Screenshot 2022-11-02 215137.png

 

If you have any idea how to make this more concise or beautiful, please let me know. I think I got the basic understanding of DAX syntax now.

Helpful resources

Announcements
FabCon Global Hackathon Carousel

FabCon Global Hackathon

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

Check out the October 2025 Power BI update to learn about new features.

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.