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

Join us at FabCon Vienna from September 15-18, 2025, for the ultimate Fabric, Power BI, SQL, and AI community-led learning event. Save €200 with code FABCOMM. Get registered

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
May FBC25 Carousel

Fabric Monthly Update - May 2025

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

June 2025 community update carousel

Fabric Community Update - June 2025

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