Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.
Register now!Calling all Data Engineers! Fabric Data Engineer (Exam DP-700) live sessions are back! Starting October 16th. Sign up.
I am getting an error saying Dax comparison operations do not support comparing values of text with values of type number. How to fix?
I have this formula. I am trying to see if a customer is a gained customer compared to the year prior and the rest of the years before the current year. I want to write a formula that says if in the current year the customer did (selectedthreshold value) or more and in the prior year they did less than that value then they are a gained customer.
I have this right now.
gained customer =
var selectedthreshold = selectedvalue('Table'[number])
var currentyear= selectedvalue('time'[year])
var prioryear= (currentyear)-1
return
calculate(countrows, filter, values(sales[customerID]),
calculate(units, 'time'[year]=currentyear)>= selectedthreshold && calculate(units, 'time'[year]= prioryear)<selectedthreshold )))
please help. I am not sure if I have the right logic as well.
@dancer10-10 Check the data types of your columns, number and year and make sure they are all set to Whole number or Decimal. Or, you can always do +0 to make sure any numeric text gets converted to a number.
Also, I have no idea what this line is:
calculate(countrows, filter, values(sales[customerID]),
calculate(units, 'time'[year]=currentyear)>= selectedthreshold && calculate(units, 'time'[year]= prioryear)<selectedthreshold )))
It doesn't look right at all.
Thank you. Do you know the correct logic to get the formula that I want to get based on the description above?
@dancer10-10 Try something like this:
Better Sales from New Customers - Microsoft Fabric Community
gained 2 = var current_customers= DISTINCT(Sales[customer ID]) var mindate = SELECTEDVALUE(Sales[YearONLY]) var selectedthreshold3= SELECTEDVALUE('Gain Loss Numbers'[numbers Gain/Loss]) var table_ = FILTER(ALL(Sales), IF(selectedthreshold3<[units],1) ) var previouscustomer= DISTINCT(SELECTCOLUMNS(table_, "customer ID", Sales[customer ID])) var newcustomer= EXCEPT(current_customers,previouscustomer) return SUMX(FILTER(Sales,Sales[customer ID] IN newcustomer),[units])
Is this correct? I am new to power bi. It says that there is not enough memory to complete operation.
@dancer10-10 It's really tough to say. Can you post sample/example data?
Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!
Check out the September 2025 Power BI update to learn about new features.