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 during Fabric Data Days. Don't miss your chance! Request now
Hope you are doing well.
I am having trouble with a calculation:
if [Active Stage] = "Active" then Duration.Days( [today]-[Joining]) else 0)
I am trying to find the tenure of employee but it keeps me throwing the error below for every Active records in Active Stage.
Expression.Error: We cannot apply operator - to types Text and Date.
Details:
Operator=-
Left=18-07-2024
Right=26-07-2023
today column=DateTime.ToText(DateTime.LocalNow(), "dd-MM-yyyy"))
Any help or suggestions to over come this error would be of great help. enclosing the scrrenshot to validate the date format.
Solved! Go to Solution.
Hi @sunny18pc
You can use below code for today. It still remains date type.
today column=Date.From(DateTime.LocalNow())
Best Regards,
Jing
Hi @sunny18pc
You can use below code for today. It still remains date type.
today column=Date.From(DateTime.LocalNow())
Best Regards,
Jing
Check out the November 2025 Power BI update to learn about new features.
Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!
| User | Count |
|---|---|
| 11 | |
| 10 | |
| 5 | |
| 4 | |
| 4 |
| User | Count |
|---|---|
| 24 | |
| 17 | |
| 13 | |
| 10 | |
| 10 |