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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now

Reply
karladizmal
New Member

Expressions that yield variant data-type cannot be used to define calculated columns.

Hi All!

Very new at PBI. 

I am trying to make a matchkey in the table view with a concatenate, but I get the subject message error. 

 

Here's the expression:

Matchkey = IF(AND('wo duplicates'[QuotedMfr] <> BLANK(), 'wo duplicates'[QuotedPart] <> BLANK()),'wo duplicates'[QuotedMfr] && 'wo duplicates'[QuotedPart], "")
2 ACCEPTED SOLUTIONS
Anonymous
Not applicable

Hi,@karladizmal 

Regarding the issue you raised, my solution is as follows:

1.First I have created the following table and the column names and data are the data you have given:

 

vlinyulumsft_0-1721699968591.png

We've reproduced your code, and we've got the following result.

vlinyulumsft_1-1721699968592.png

2.We believe that the reason for this result is that you determine whether both columns are empty and then determine whether two columns of values exist, and the end result is a Boolean value.

So we can change the False result of the If() function to either the False() function or the Blank().

Matchkey =
IF (
    AND (
        'wo duplicates'[QuotedMfr] <> BLANK (),
        'wo duplicates'[QuotedPart] <> BLANK ()
    ),
    'wo duplicates'[QuotedMfr] && 'wo duplicates'[QuotedPart],
    BLANK ()
)

3.I'm guessing you might need the following calculated columns:

merge =
IF (
    AND (
        'wo duplicates'[QuotedMfr] <> BLANK (),
        'wo duplicates'[QuotedPart] <> BLANK ()
    ),
    'wo duplicates'[QuotedMfr] & " " & 'wo duplicates'[QuotedPart],
    "0"
)

 

4.Here's my final result, which I hope meets your requirements.

vlinyulumsft_2-1721700054718.png

Can you share sample data and sample output in tabular format if I am misunderstanding? Or a sample pbix after removing sensitive data. We can better understand the problem and help you.

 

Please find the attached pbix relevant to the case.

 

Best Regards,

Leroy Lu

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

Ashish_Mathur
Super User
Super User

Hi,

Try this

Matchkey = IF(AND('wo duplicates'[QuotedMfr] <> BLANK(), 'wo duplicates'[QuotedPart] <> BLANK()),'wo duplicates'[QuotedMfr] & 'wo duplicates'[QuotedPart], blank())

Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/

View solution in original post

3 REPLIES 3
Ashish_Mathur
Super User
Super User

Hi,

Try this

Matchkey = IF(AND('wo duplicates'[QuotedMfr] <> BLANK(), 'wo duplicates'[QuotedPart] <> BLANK()),'wo duplicates'[QuotedMfr] & 'wo duplicates'[QuotedPart], blank())

Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/
karladizmal
New Member

I have tried replacing "" with 0 but it doesn't work. Any ideas?

Anonymous
Not applicable

Hi,@karladizmal 

Regarding the issue you raised, my solution is as follows:

1.First I have created the following table and the column names and data are the data you have given:

 

vlinyulumsft_0-1721699968591.png

We've reproduced your code, and we've got the following result.

vlinyulumsft_1-1721699968592.png

2.We believe that the reason for this result is that you determine whether both columns are empty and then determine whether two columns of values exist, and the end result is a Boolean value.

So we can change the False result of the If() function to either the False() function or the Blank().

Matchkey =
IF (
    AND (
        'wo duplicates'[QuotedMfr] <> BLANK (),
        'wo duplicates'[QuotedPart] <> BLANK ()
    ),
    'wo duplicates'[QuotedMfr] && 'wo duplicates'[QuotedPart],
    BLANK ()
)

3.I'm guessing you might need the following calculated columns:

merge =
IF (
    AND (
        'wo duplicates'[QuotedMfr] <> BLANK (),
        'wo duplicates'[QuotedPart] <> BLANK ()
    ),
    'wo duplicates'[QuotedMfr] & " " & 'wo duplicates'[QuotedPart],
    "0"
)

 

4.Here's my final result, which I hope meets your requirements.

vlinyulumsft_2-1721700054718.png

Can you share sample data and sample output in tabular format if I am misunderstanding? Or a sample pbix after removing sensitive data. We can better understand the problem and help you.

 

Please find the attached pbix relevant to the case.

 

Best Regards,

Leroy Lu

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


 

Helpful resources

Announcements
November Power BI Update Carousel

Power BI Monthly Update - November 2025

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

Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

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 Solution Authors