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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now

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
November Fabric Update Carousel

Fabric Monthly Update - November 2025

Check out the November 2025 Fabric update to learn about new features.

Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.