Forum Discussion
Katerina
6 years agoHelper I
IF function doesn't work
Hi all! I meet a strange error in my PBI file. This file was created last year and all worked perfect. Today I opened it and see the error in following function: 11 = var q = 0,7 RETURN IF( 'tab...
Katerina
6 years agoHelper I
Application language and Model language - English (United States)
Stachu
6 years agoCommunity Champion
I think amitchandak is right, it's because of regional settings. My guess is that you don't have standard list and decimal separator, and they are both set to "," (I strongly recommend changing it, especially if you work with csv files), similar to the post here:
https://community.powerbi.com/t5/Power-Query/IF-with-text-and-numbers/m-p/763520/highlight/true#M25505
If that's the case this code may work (added space after q)
11 =
var q = 0,7
RETURN IF( 'table'[Column] > q , "1", "2" )
as well as this one if you need numbers and not text - with the same decimal and list separator this is actually valid DAX, but you can see it's very confusing (1,0 is actually considered 1 in this case)
11 =
var q = 0,7
RETURN IF( 'table'[Column] > q , 1,0 , 2,0 )