Advance your Data & AI career with 50 days of live learning, dataviz contests, hands-on challenges, study groups & certifications and more!
Get registeredGet Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Learn more
Hello All,
I have the following issue. I try to insert a custom column i Edit Query mode ow my report where to calculate the days overdue according to today. I tried the following: DateTime.Date(DateTime.LocalNow())-[Due Date], but then the result was 24 days. This is not my mission, because I have overdues from 1st August 2016, which I get as 24 day overdue and it is not correct. What formula should I use. It is easy for me to do it in query mode with DATEDIFF but this is not what I want.
Thank you all in advance.
Solved! Go to Solution.
Hi @ganchevd,
You can use Duration functions, please use the following M formula, which will give you the "Datediff" in days. But you can also have other datepart types as well.
=Duration.Days(Duration.From(DateTime.LocalNow()-[Date]))
Please see the expected result using my sample table date.
Best Regards,
Angelia
This literally didn't work.
Hi @ganchevd,
You can use Duration functions, please use the following M formula, which will give you the "Datediff" in days. But you can also have other datepart types as well.
=Duration.Days(Duration.From(DateTime.LocalNow()-[Date]))
Please see the expected result using my sample table date.
Best Regards,
Angelia
Works perfectly! Thank you
Please post some sample data so we can assist in more detail. Thank You
Proud to give back to the community!
Thank You!
Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!
Check out the October 2025 Power BI update to learn about new features.