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
rmeng
Helper II
Helper II

Custom Column IF Statement with Concatenation

I want a Custom Column with a IF Statement like this:

 

if [counts] = "Yes" then [date]&[mdm ID]&[User ID] else null

Can you Help me?

 

Untitled.jpg

 

 

 

 

 

1 ACCEPTED SOLUTION
v-alq-msft
Community Support
Community Support

Hi, @rmeng 

 

You need to use 'Text.From' function to change the date types of '[Date]', '[mdm ID]', '[User ID]' as text before the concatenation. The pbix file is attached in the end.

 

I created data to reproduce your scenario.

Table:

c1.png

 

Then you may create a custom column as below.

if [Counts]="Yes" then Text.From([Date])& Text.From([mdm ID])&Text.From( [User ID]) else null

 

c2.png

 

Result:

c3.png

 

Best Regards

Allan

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

 

 

View solution in original post

2 REPLIES 2
v-alq-msft
Community Support
Community Support

Hi, @rmeng 

 

You need to use 'Text.From' function to change the date types of '[Date]', '[mdm ID]', '[User ID]' as text before the concatenation. The pbix file is attached in the end.

 

I created data to reproduce your scenario.

Table:

c1.png

 

Then you may create a custom column as below.

if [Counts]="Yes" then Text.From([Date])& Text.From([mdm ID])&Text.From( [User ID]) else null

 

c2.png

 

Result:

c3.png

 

Best Regards

Allan

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

 

 

AlB
Community Champion
Community Champion

Hi @rmeng 

The code that you show looks good. Doesn't it work? What is the problem?

You'd just have to create a custome column in the query and add your code. It should work

 

Please mark the question solved when done and consider giving kudos if posts are helpful.

Contact me privately for support with any larger-scale BI needs, tutoring, etc.

Cheers 

 

SU18_powerbi_badge

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.

Top Kudoed Authors