The ultimate Fabric, Power BI, SQL, and AI community-led learning event. Save €200 with code FABCOMM.
Get registeredEnhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends September 15. Request your voucher.
Hi all,
So I executed the following function
Column = SWITCH(TRUE(),
Column[A] = "Group 1" && [Income] > 99000, "25000",
Column[B] = "Group2" && [Income] > 99000, "35000",
Column[C] = "Group 3" && [Income] > 99000, "45000",
[Income])
And I get the "Expressions that yield variant data-type cannot be used to define calculated columns" error. Column[A] is in text format & [Income] is a Number.
Could someone kindly assist on how to get around this problem
Solved! Go to Solution.
Hi, @Anonymous
Based on the error message, it is caused by the different data types in column.
"25000", "35000","45000" is in Text format while [Income] is in Number format.
You need to keep the data types in the same column consistent.
You can change the data type of column [Income] to “Text”.
Best Regards,
Community Support Team _ Eason
Hi, @Anonymous
Based on the error message, it is caused by the different data types in column.
"25000", "35000","45000" is in Text format while [Income] is in Number format.
You need to keep the data types in the same column consistent.
You can change the data type of column [Income] to “Text”.
Best Regards,
Community Support Team _ Eason
Hi @Anonymous
you can try
Column =
SWITCH (
TRUE (),
Column[A] = "Group 1"
&& [Income] > 99000, 25000,
Column[B] = "Group2"
&& [Income] > 99000, 35000,
Column[C] = "Group 3"
&& [Income] > 99000, 45000,
[Income]
)