Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.
Sign up nowGet 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])
If you love stickers, then you will definitely want to check out our Community Sticker Challenge!
Check out the January 2026 Power BI update to learn about new features.
| User | Count |
|---|---|
| 64 | |
| 63 | |
| 48 | |
| 21 | |
| 18 |
| User | Count |
|---|---|
| 118 | |
| 117 | |
| 38 | |
| 36 | |
| 27 |