Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes! Register now.

Reply
Casi
Helper I
Helper I

Calculate absence days with no end date

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.

1 ACCEPTED SOLUTION
Vijay_A_Verma
Super User
Super User

Use this

= {Number.From([Absence.Start])..Number.From(if [Absence.End]=null or [Absence.End]="" then Date.From(DateTime.FixedLocalNow()) else [Absence.End])}

 

View solution in original post

2 REPLIES 2
Casi
Helper I
Helper I

Perfect. Thank you

Vijay_A_Verma
Super User
Super User

Use this

= {Number.From([Absence.Start])..Number.From(if [Absence.End]=null or [Absence.End]="" then Date.From(DateTime.FixedLocalNow()) else [Absence.End])}

 

Helpful resources

Announcements
September Power BI Update Carousel

Power BI Monthly Update - September 2025

Check out the September 2025 Power BI update to learn about new features.

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.