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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
ANB_13
Helper I
Helper I

Create a new conditional column with difference of dates

Hello everyone, 

 

I want to create a new conditional date :  i have a column XXX with date (with some empty fields) and i want to create a new column with conditions : 

  • If the difference between column XXX and the day of today (30/05/2023 today, 31/05/2023 tomorrow etc) is between 0 and 60 days, so the output is "A
  • If the difference between column XXX and the day of today (30/05/2023 today, 31/05/2023 tomorrow etc) is between 60 and 90 days, so the output is "B"
  • If the difference between column XXX and the day of today (30/05/2023 today, 31/05/2023 tomorrow etc) is plus than 90 days, so the output is "C"

How can i create this column ?

 

Thank you very much 

Regards

1 ACCEPTED SOLUTION
trt18-sistemas
Advocate III
Advocate III

Hi @ANB_13,

Check at image bellow the Power Query function how to create a new collumn as you wish. The trick here is know how to use Duration.Days() function.

 

trt18sistemas_0-1685449733644.png


If you think it is solved your problem, please, consider to mark it as solution.

Regards

View solution in original post

1 REPLY 1
trt18-sistemas
Advocate III
Advocate III

Hi @ANB_13,

Check at image bellow the Power Query function how to create a new collumn as you wish. The trick here is know how to use Duration.Days() function.

 

trt18sistemas_0-1685449733644.png


If you think it is solved your problem, please, consider to mark it as solution.

Regards

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

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

April Fabric Community Update

Fabric Community Update - April 2024

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

Top Solution Authors