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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
Anonymous
Not applicable

ISO Year

Hi all,

 

I'am receiving a error message using the following DAX formula, 'Expressions that yield variant data-type cannot be used to define calculated columns.'. I can't figure out what is wrong. The first part of the formula (before the second IF(AND) is working fine.

 

ISO YEAR = IF(AND(WEEKNUM(DateDIM2[datum];21) < 5 ; WEEKNUM(DateDIM2[datum];2) > 50) ; DateDIM2[Jaar]+1 ; IF(AND(WEEKNUM(DateDIM2[datum]; 21) > 50 ; WEEKNUM(DateDIM2[datum]; 2) < 5 ); DateDIM2[Jaar] - 1 ; DateDIM2[Jaar]))

Thanks a lot for helping me out.

 

Greetings Ronald

Ps. @fbrossard

 

 

 

 

 

 

 

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi @Omega,

 

 

I found the solution. My Year column was formatted as text instead of a number value. This was the cause of the problem, because I was adding 1 to a text field. Thanks for replying. 

 

Greetings

Ronald

 

View solution in original post

2 REPLIES 2
Omega
Impactful Individual
Impactful Individual

Can you please share the PBIX and what are you trying to calculate?

Anonymous
Not applicable

Hi @Omega,

 

 

I found the solution. My Year column was formatted as text instead of a number value. This was the cause of the problem, because I was adding 1 to a text field. Thanks for replying. 

 

Greetings

Ronald

 

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

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

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.