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 nowThe Fabric community is now in read-only for platform upgrade. Learn more
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. 😎
Join us in Barcelona for FabCon and SQLCon, the Fabric, Power BI, SQL, and AI community event. Save €200 with code FABCMTY200.