Forum Discussion
Anonymous
3 years agoNot applicable
Expressions that yield variant data-type cannot be used to define calculated columns.
i get an error while having the below caluclated column
IF('Scores'[Current/Last]="-","-",IF('Scores'[Question Scores]<>0, IF(_score='Scores'[Question Scores],0,_score) ))
Do anyone know how to solve the error?
5 Replies
- Greg_Deckler
Community Champion
Anonymous Try below. You either need to return all text or all numbers, not text and numbers.
IF('Scores'[Current/Last]="-","-",IF('Scores'[Question Scores]<>0, IF(_score='Scores'[Question Scores],"0",_score & "") ))- AnonymousNot applicable
But if i return it into calculated column, it will return error as well. Or i need to use the format function in DAX? if yes, how should it be like?
- Greg_Deckler
Community Champion
Anonymous The measure I posted returns all text. Alternatively, you could write the formula this way to return either BLANK or numbers and it would work as well:
IF('Scores'[Current/Last]="-",BLANK(),IF('Scores'[Question Scores]<>0, IF(_score='Scores'[Question Scores],0,_score) ))