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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

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 IV
Advocate IV

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 IV
Advocate IV

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
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

November Power BI Update Carousel

Power BI Monthly Update - November 2025

Check out the November 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.