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

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

Reply
ahuhn
Helper I
Helper I

Column = IF(Table3[size]=1,CONCATENATE("*",Table3[size]),0)

I have a table, and want to examine the value of a column, then start it with an * if it meets a condition. Unfortunately, I receive the following error:

 

Column = IF(Table3[size]=1,CONCATENATE("*",Table3[size]),0)

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

 

Where as:

Column = CONCATENATE("*",Table3[size]) works

 

I followed suggestions from https://community.powerbi.com/t5/Desktop/Expressions-that-yield-variant-data-type-cannot-be-used-to/... to no avail

 

I also tried converting int to string, as per https://community.powerbi.com/t5/Desktop/DAX-function-for-converting-a-number-into-a-string/td-p/507... to no avail.

 

Here is my data

Picture1.png

 

 

suggestions welcome

2 ACCEPTED SOLUTIONS
Anonymous
Not applicable

The problem is:

 

The '0' at the end. It is numeric type.

 

Use this and it will work:

 

Column = IF(Table1[Size]=1,"*"&Table1[Size],"0")

View solution in original post

Anonymous
Not applicable

Maybe you can try the following DAX

 

Column = IF(Table1[Size]=1,CONCATENATE("*",Table1[Size]),"0")

2018-10-10_17-11-23.jpg

 

View solution in original post

2 REPLIES 2
Anonymous
Not applicable

Maybe you can try the following DAX

 

Column = IF(Table1[Size]=1,CONCATENATE("*",Table1[Size]),"0")

2018-10-10_17-11-23.jpg

 

Anonymous
Not applicable

The problem is:

 

The '0' at the end. It is numeric type.

 

Use this and it will work:

 

Column = IF(Table1[Size]=1,"*"&Table1[Size],"0")

Helpful resources

Announcements
PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

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