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

Calling all Data Engineers! Fabric Data Engineer (Exam DP-700) live sessions are back! Starting October 16th. Sign up.

Reply
RobertoArreola8
Regular Visitor

Calculate a text value from a date column

Hi gurus!

 

I need your help as im trying to add a calculated column on a table. 

Basically I need everything greater than today's date to be classified as "new", I've tried to do something like this:

 

Status= IF('OSS Credit Notes'[InvoiceDate]>= TODAY()-1, "New", 'OSS Credit Notes'[InvoiceDate])

RobertoArreola8_0-1672961728149.png

RobertoArreola8_1-1672961745364.png

 

But I don't think is possible to assign text values from a date field... as i get the following warning:

 

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

 

Anyone with any solution? 😁

 

Thank you!

3 REPLIES 3
FreemanZ
Super User
Super User

hi @RobertoArreola8 

just try like:

Status= IF('OSS Credit Notes'[InvoiceDate]>TODAY(), "New", 'OSS Credit Notes'[InvoiceDate])

Thank you! But it seems still is not working 😔

 

I keep getting the same warning:

RobertoArreola8_0-1672962588886.png

 

AHA try like

Status= IF([InvoiceDate]>TODAY(), "New", FORMAT([InvoiceDate], "YYYY/MM/DD"))

@RobertoArreola8 

Helpful resources

Announcements
FabCon Global Hackathon Carousel

FabCon Global Hackathon

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

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

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.