Formula error variant data-type

MrJoosten

Board Regular
Joined
Nov 12, 2016
Messages
118
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:
Code:
Column = IF([Customer Description] = "Export";"";IF(OR([Type] = "ACT 2017";AND(MONTH([Calendar day]) = MONTH(TODAY());WEEKNUM([Calendar day]) < WEEKNUM(TODAY())));[HL];""))

Error:
Code:
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?
 

Excel Facts

How to find 2nd largest value in a column?
MAX finds the largest value. =LARGE(A:A,2) will find the second largest. =SMALL(A:A,3) will find the third smallest
So the formula could return an empty text string, or the value from column [HL]?

What data type is column [HL]?
 
Upvote 0
Hi Norie,

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

Could this cause the error?

Thx.
 
Upvote 0
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.
 
Upvote 0

Forum statistics

Threads
1,213,513
Messages
6,114,072
Members
448,546
Latest member
KH Consulting

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top