cancel
Showing results for
Did you mean:

Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started

Helper V

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

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:

Thank you for help.

2 ACCEPTED SOLUTIONS
Super User

@koray , 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")

Community Champion

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

Proud to be a Super User!

3 REPLIES 3
Helper V

Thank you both for your help.

Community Champion

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

Proud to be a Super User!

Super User

@koray , 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")

Announcements

#### Europe’s largest Microsoft Fabric Community Conference

Join the community in Stockholm for expert Microsoft Fabric learning including a very exciting keynote from Arun Ulag, Corporate Vice President, Azure Data.

#### Power BI Monthly Update - June 2024

Check out the June 2024 Power BI update to learn about new features.

#### Fabric Community Update - June 2024

Get the latest Fabric updates from Build 2024, key Skills Challenge voucher deadlines, top blogs, forum posts, and product ideas.

#### New forum boards available in Real-Time Intelligence.

Ask questions in Eventhouse and KQL, Eventstream, and Reflex.

Top Solution Authors
Top Kudoed Authors