# Formula error variant data-type



## MrJoosten (Apr 19, 2017)

Hi Guys, 

I'm starting with PowerBI and I need some help with a formula. (calculated column) 
Maybe my formula is very much excel like, and that's why I go wrong... 

Formula: 

```
Column = IF([Customer Description] = "Export";"";IF(OR([Type] = "ACT 2017";AND(MONTH([Calendar day]) = MONTH(TODAY());WEEKNUM([Calendar day]) < WEEKNUM(TODAY())));[HL];""))
```

Error: 

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

I don't know why this is resulting in an error. Columns "Customer Description" & "Type" are both in text format. 


What the formula does: 
If column Customer Description = Export then blank
If column Customer Description = not Export then, or if type = ACT 2017, or month = this month and week is < then current week, then column HL. 

Can anyone help?


----------



## Norie (Apr 19, 2017)

So the formula could return an empty text string, or the value from column [HL]?

What data type is column [HL]?


----------



## MrJoosten (Apr 19, 2017)

Hi Norie, 

Thanks for your reply. 
Column HL is a decimal number data type. 

Could this cause the error? 

Thx.


----------



## MrJoosten (Apr 19, 2017)

And yes, it returns empty or the value from HL.


----------



## Norie (Apr 19, 2017)

Well as far as I can see you are returning 2 data types, "" - string, or the value from [HL] - numeric.

Try changing "" to 0 and see if that works.


----------



## MrJoosten (Apr 19, 2017)

You are the man! Thanks Norie!  

Good to keep that in mind.


----------

