Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.
Register now!The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more
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
Solved! Go to Solution.
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
Can you please share the PBIX and what are you trying to calculate?
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
The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!
| User | Count |
|---|---|
| 38 | |
| 38 | |
| 37 | |
| 28 | |
| 25 |
| User | Count |
|---|---|
| 124 | |
| 87 | |
| 70 | |
| 66 | |
| 65 |