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!To celebrate FabCon Vienna, we are offering 50% off select exams. Ends October 3rd. Request your discount now.
Hi,
I wonder if someone could help me with my query.
I am trying to calculate days of staff absence. I have created a query which works for the majority of absences apart from ones that have no end date yet.
Days ={Number.From([Absence.Start])..Number.From([Absence.End])}
I am wondering if it possible to amend this query so that if there is no end date it will use todays date? Any assistance would be greatly appreciated.
Solved! Go to Solution.
Use this
= {Number.From([Absence.Start])..Number.From(if [Absence.End]=null or [Absence.End]="" then Date.From(DateTime.FixedLocalNow()) else [Absence.End])}
Perfect. Thank you
Use this
= {Number.From([Absence.Start])..Number.From(if [Absence.End]=null or [Absence.End]="" then Date.From(DateTime.FixedLocalNow()) else [Absence.End])}