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

Score big with last-minute savings on the final tickets to FabCon Vienna. Secure your discount

Reply
Rio007
Helper I
Helper I

Expressions that yield variant data-type cannot be used to define calculated columns

 I'm having a table where I'm trying to categrorise all the date before 1/1/2000 as bad and after 1/1/2000 the actual date from each corresponding row.
This is the DAx I wrote:

Draft = IF ( 'TableA'[A] >=153864"bad" , 'Fact'[A). I also tried this
Draft = IF( CONVERT('TableA'[A],STRING)>="153864","bad",'TableA'[A])

and this is the error I Get  "Expressions that yield variant data-type cannot be used to define calculated columns."

I tried several versions of if but I still get the same error. Thank You for helping me with this.
1 ACCEPTED SOLUTION
Anonymous
Not applicable

I think you need to use the CONVERT function a second time, assuming [A] is an integer.

Try: Draft = IF( CONVERT('TableA'[A],STRING)>="153864","bad",CONVERT(TableA'[A], STRING))

View solution in original post

2 REPLIES 2
Rio007
Helper I
Helper I

@Anonymous  Thanks a lot that's the solution

Anonymous
Not applicable

I think you need to use the CONVERT function a second time, assuming [A] is an integer.

Try: Draft = IF( CONVERT('TableA'[A],STRING)>="153864","bad",CONVERT(TableA'[A], STRING))

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.