Forum Discussion

WhaleWatcher222's avatar
1 year ago
Solved

Dax measure error text and numerical values

Hi Experts

 

Cannot see the wood for the trees here where my error is - with the following DAX

 

1.1 Blanks = 
VAR Avalue = AVERAGE([1.1])
VAR _NA = IF(VALUE(Avalue) = "N/A", "N/A",Avalue)
VAR _Blank = IF(ISBLANK(Avalue) = "--",Avalue)

RETURN
    COALESCE(_NA, _Blank)
  • WhaleWatcher222 So, in looking at this, you have code that returns a variant, as in it might return text or a number. That's not allowed. Has to be one or the other. BLANK() is acceptable for both but you have to have it return either always text or always a number.

2 Replies

  • Greg_Deckler's avatar
    Greg_Deckler
    Icon for Community Champion rankCommunity Champion

    WhaleWatcher222 So, in looking at this, you have code that returns a variant, as in it might return text or a number. That's not allowed. Has to be one or the other. BLANK() is acceptable for both but you have to have it return either always text or always a number.