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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply
HV27
New Member

To set criteria using Calculated columns.

CustIncome = SWITCH(TRUE(),
                          DimCustomer[YearlyIncome] < 25,000, "LOW INCOME",
                          DimCustomer[YearlyIncome] >= 25,000 && DimCustomer[YearlyIncome] <= 60,000 , "Middle Income",
                          DimCustomer[YearlyIncome] >= 60,000 && DimCustomer[YearlyIncome] <= 100,000 , "Higher Income",
                          DimCustomer[YearlyIncome] >= 100,000, "Very High Income")
 
 
I have written this DAX code to set crteria for income in creating calculated column but, getting the following error:
Function 'SWITCH' does not support comparing values of type True/False with values of type Text. Consider using the VALUE or FORMAT function to convert one of the values.
1 REPLY 1
edchuy
Advocate V
Advocate V

Taking a quick look at your code, it looks to me that you should remove commas that you have added to the numbers since those are probably the reason why they are being considered as text rather than as a number. Let me know if this fixes your code.

Helpful resources

Announcements
July 2025 community update carousel

Fabric Community Update - July 2025

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