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

Get Fabric certified for FREE! Don't miss your chance! Learn more

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
Join our Fabric User Panel

Join our Fabric User Panel

Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.

February Fabric Update Carousel

Fabric Monthly Update - February 2026

Check out the February 2026 Fabric update to learn about new features.

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.