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

Microsoft is giving away 50,000 FREE Microsoft Certification exam vouchers. Get Fabric certified for FREE! Learn more

Reply
Anonymous
Not applicable

Custom column: Add text to data for different

Hello,

 

I have a column that calculates the date data coming from Excel according to today.

 

Kalan Gün = DATEDIFF(Liste[Bir Sonraki Validasyon Tarihi],TODAY(),DAY)

 

koray_0-1616156408139.png

 

If the data in this column starts with "-" then "Days Left", if it doesn't starts with "-", I want to bring "Days Passed" text.

 

Like this:

koray_1-1616156925554.png

 

Thank you for help.

2 ACCEPTED SOLUTIONS
amitchandak
Super User
Super User

@Anonymous , Try a new column like

Kalan Gün =
var _1 = DATEDIFF(Liste[Bir Sonraki Validasyon Tarihi],TODAY(),DAY)
return
if(_1 <0, _1 & " Days Left" , _1 & " Days Passed")

Full Power BI Video 20 Hours YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

View solution in original post

negi007
Community Champion
Community Champion

@Anonymous 

 

you can create your column like below

 

Column=
var diff = DATEDIFF('Date'[Date].[Date],TODAY()-50,DAY)
return
if (diff<0,diff&"-Days Left",diff&" days Passed")

 

let me know if it works for you or not. thanks




Did I answer your question? Mark my post as a solution!
Appreciate your Kudos



Proud to be a Super User!


Follow me on linkedin

View solution in original post

3 REPLIES 3
Anonymous
Not applicable

Thank you both for your help.

negi007
Community Champion
Community Champion

@Anonymous 

 

you can create your column like below

 

Column=
var diff = DATEDIFF('Date'[Date].[Date],TODAY()-50,DAY)
return
if (diff<0,diff&"-Days Left",diff&" days Passed")

 

let me know if it works for you or not. thanks




Did I answer your question? Mark my post as a solution!
Appreciate your Kudos



Proud to be a Super User!


Follow me on linkedin

amitchandak
Super User
Super User

@Anonymous , Try a new column like

Kalan Gün =
var _1 = DATEDIFF(Liste[Bir Sonraki Validasyon Tarihi],TODAY(),DAY)
return
if(_1 <0, _1 & " Days Left" , _1 & " Days Passed")

Full Power BI Video 20 Hours YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

Helpful resources

Announcements
PBIApril_Carousel

Power BI Monthly Update - April 2025

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

Notebook Gallery Carousel1

NEW! Community Notebooks Gallery

Explore and share Fabric Notebooks to boost Power BI insights in the new community notebooks gallery.

April2025 Carousel

Fabric Community Update - April 2025

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

Top Solution Authors