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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends September 15. Request your voucher.

Reply
WhaleWatcher222
Helper II
Helper II

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)
1 ACCEPTED SOLUTION
Greg_Deckler
Community Champion
Community 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.



Follow on LinkedIn
@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
DAX For Humans

DAX is easy, CALCULATE makes DAX hard...

View solution in original post

2 REPLIES 2
WhaleWatcher222
Helper II
Helper II

Thanks Thought as much

Greg_Deckler
Community Champion
Community 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.



Follow on LinkedIn
@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
DAX For Humans

DAX is easy, CALCULATE makes DAX hard...

Helpful resources

Announcements
August Power BI Update Carousel

Power BI Monthly Update - August 2025

Check out the August 2025 Power BI update to learn about new features.

August 2025 community update carousel

Fabric Community Update - August 2025

Find out what's new and trending in the Fabric community.