cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Jonas_Jonas Frequent Visitor
Frequent Visitor

Datatype variant

Hello everybody!

 

I have two columns. A text column with different colors in it and a number column with values.

When i build the IF function there is the error message:

Can not use expressions that return the variant data type to define computed columns.

IF-Funtion:

= IF(table1[COLOR]="BLACK";table1[VALUE]*(-1);table1[COLOR])

 

I tried many different opportunities and i cant find the answer.

 

With kind regards

Jonas

1 ACCEPTED SOLUTION

Accepted Solutions
Jonas_Jonas Frequent Visitor
Frequent Visitor

Re: Datatype variant

Hi everybody!

 

I solved the problem on my own.

 

Instead of writing *(-1) in the IF function, write a new measure with "-1".

 

The new IF function than is:

= IF(table1[COLOR]="BLACK";table1[VALUE]*([Measure];table1[COLOR])

 

With kind regards

Jonas

View solution in original post

1 REPLY 1
Jonas_Jonas Frequent Visitor
Frequent Visitor

Re: Datatype variant

Hi everybody!

 

I solved the problem on my own.

 

Instead of writing *(-1) in the IF function, write a new measure with "-1".

 

The new IF function than is:

= IF(table1[COLOR]="BLACK";table1[VALUE]*([Measure];table1[COLOR])

 

With kind regards

Jonas

View solution in original post

Helpful resources

Announcements
New Topics Started Badges Coming

New Topics Started Badges Coming

We're releasing new versions of the badge that everyone's talking about. ;) Check your inbox for notifications.

MBAS 2020

Save the new date (and location)!

Our business applications community is growing—so we needed a different venue, resulting in a new date and location. See you there!

Difinity Conference

Difinity Conference

The largest Power BI, Power Platform, and Data conference in New Zealand

Top Solution Authors
Top Kudoed Authors (Last 30 Days)