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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now

Reply
Anonymous
Not 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 5
Greg_Deckler
Community Champion
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 & "") ))

 



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...
Anonymous
Not 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?

@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) ))


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...
Anonymous
Not applicable

But exactly want "-", as i need to use "-" in the report view if it is no data instead of just blank. Any idea for that?

@Anonymous Use the first formula then. Bottom line, you either need to return text or return numbers. You *might* be able to use the second form for a number and use a Custom Format String to display your blank values as "-". Use custom format strings in Power BI Desktop - Power BI | Microsoft Learn



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
November Power BI Update Carousel

Power BI Monthly Update - November 2025

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

Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Solution Authors
Top Kudoed Authors