Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.
Register now!Get Fabric certified for FREE! Don't miss your chance! Learn more
Hi, I am trying to create new column to show difference with days between two dates through Power Query but I am not getting expected results. I have 2 columns DOJ(Date of Joining) and DOL(Date of Leaving). If DOJ date column is blank then use Today's date minus DOL else DOJ minus DOL . I tried 2 different ways, 1) with Custom Column 2) Date calculate Age and then edited . They both are giving me same results.
= Table.AddColumn(#"Removed Columns", "Custom", each if [DOJ New Joiner] = null then Date.From(DateTime.LocalNow())-[DOL] else [DOJ New Joiner] - [DOL])
= Table.AddColumn(#"Added Custom", "Age", each if [DOJ New Joiner] = null then Date.From(DateTime.LocalNow()) - [DOL] else [DOJ New Joiner]-[DOL])
Hi @amol0512 ,
Has your problem been solved, if so, please consider Accept a correct reply as the solution or share your own solution to help others find it.
Best Regards
Lucien
@amol0512 , seem correct , Try like
Duration.Days(if [DOJ New Joiner] = null then Date.From(DateTime.LocalNow()) - [DOL] else [DOJ New Joiner]-[DOL])
Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.
Check out the February 2026 Power BI update to learn about new features.
| User | Count |
|---|---|
| 69 | |
| 59 | |
| 47 | |
| 20 | |
| 16 |
| User | Count |
|---|---|
| 107 | |
| 107 | |
| 39 | |
| 27 | |
| 27 |