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

Learn from the best! Meet the four finalists headed to the FINALS of the Power BI Dataviz World Championships! Register now

Reply
randomfluky1
New Member

Power Query Dax Date Help

HI,

 

I'm a beginner at Power BI and I'm not so good at Dax.

 

I am trying to create a custom column where it states whether someone is a leaver from 6 years ago or not. 

 

Everything I try is wrong!

 

if [leavedate] = <= DateTime.Date(DateTime.LocalNow())-6  then "Legacy Leaver" else "null")

 

Any suggestions?

 

1 ACCEPTED SOLUTION
Bifinity_75
Solution Sage
Solution Sage

Hi @randomfluky1 , you need to create this formule in Power Query (add a Custom Column):

if Duration.TotalDays((DateTime.Date(DateTime.LocalNow())-[leavedate])/365)>=6 then "Legacy Leaver" else "null"

 

The result:

Bifinity_75_0-1668024112582.png

 

Best Regards

 

View solution in original post

2 REPLIES 2
randomfluky1
New Member

Thank you

Bifinity_75
Solution Sage
Solution Sage

Hi @randomfluky1 , you need to create this formule in Power Query (add a Custom Column):

if Duration.TotalDays((DateTime.Date(DateTime.LocalNow())-[leavedate])/365)>=6 then "Legacy Leaver" else "null"

 

The result:

Bifinity_75_0-1668024112582.png

 

Best Regards

 

Helpful resources

Announcements
Join our Fabric User Panel

Join our Fabric User Panel

Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.

March Power BI Update Carousel

Power BI Community Update - March 2026

Check out the March 2026 Power BI update to learn about new features.