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

Grow your Fabric skills and prepare for the DP-600 certification exam by completing the latest Microsoft Fabric challenge.

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 III
Advocate III

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
Europe Fabric Conference

Europe’s largest Microsoft Fabric Community Conference

Join the community in Stockholm for expert Microsoft Fabric learning including a very exciting keynote from Arun Ulag, Corporate Vice President, Azure Data.

RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

Ask questions in Eventhouse and KQL, Eventstream, and Reflex.

MayFBCUpdateCarousel

Fabric Monthly Update - May 2024

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

Top Kudoed Authors