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

Get Fabric Certified for FREE during AI Skills Fest. This week only. Secure your voucher now.

Reply
Anonymous
Not applicable

Calculate the number of days between 2 dates based of a secondary column (flag)

Hi all, 

 

I am looking to show the number of days since latest date selected (from slicer) and annual leave recorded. A slicer also on dahsboard of the employee ID

I have column with everyday in it (calendardate) and a column that flags if annual leave is taken (1) or if it is not taken (0). 

Example data set below:

 

Calendar Date ID

Annual Leave

02/02/2023

1001

0

03/02/2023

10011
04/02/202310010
05/02/202310010
06/02/202310010
07/02/202310010
08/02/202310010
09/02/202310010

 

So for example data set above - date slicer set at 09/02/2022 - i would expect my KPI card to show 6 days since annual leave?

 

Any help would be great. Thanks

1 ACCEPTED SOLUTION

lbendlin_0-1678126166496.png

 

see attached.

 

View solution in original post

4 REPLIES 4
lbendlin
Super User
Super User

That looks straightforward.  What have you tried and where are you stuck?

Anonymous
Not applicable

Hi, 

 

To be honest I have tried a number of things and nothing seems to be working... My theory behind it was to calculate max date where =1 in Annual leave column and then subtract that from today but that doesn't seem to be working... your help would be greatly appreciated.

 

Thanks 

lbendlin_0-1678126166496.png

 

see attached.

 

Anonymous
Not applicable

Thanks very much... worked perfectly.

Helpful resources

Announcements
May Power BI Update Carousel

Power BI Monthly Update - May 2026

Check out the May 2026 Power BI update to learn about new features.

Fabric SQL PBI Data Days

Data Days 2026 coming soon!

Sign up to receive a private message when registration opens and key events begin.

New to Fabric survey Carousel

New to Fabric Survey

If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.