This is best Fabric, Power BI, SQL and AI community event. How do we know? The last event sold out! Save €200 with code FABCMTY200.
Register nowA new Data Days event is coming soon! This time we’re going bigger than ever. Fabric, Power BI, SQL, AI and more. Don't miss out.
Solved! Go to Solution.
Duration.Days needs to have only one parameter.
You will need to replace it with
Duration.Days(EndDt-StartDt)
Also note, you need not use EndDt as date in your function as anyway you are getting the value from another query. This is redundant. Below would work perfectly
(StartDt as date) =>
let
EndDt =TodaysDate,
Age = Duration.Days(EndDt - StartDt)
in
Age
The above query can be simply written as
(StartDt as date) => Duration.Days(TodaysDate - StartDt)
Duration.Days needs to have only one parameter.
You will need to replace it with
Duration.Days(EndDt-StartDt)
Also note, you need not use EndDt as date in your function as anyway you are getting the value from another query. This is redundant. Below would work perfectly
(StartDt as date) =>
let
EndDt =TodaysDate,
Age = Duration.Days(EndDt - StartDt)
in
Age
The above query can be simply written as
(StartDt as date) => Duration.Days(TodaysDate - StartDt)
Thank you Vijay! I am annoyed at myself for missing that obvious error! I was looking in the wrong place!
Your improved code also helps so thank you for that too. 😎
Check out the May 2026 Power BI update to learn about new features.
Sign up to receive a private message when registration opens and key events begin.
If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.