Count of working days between rest days (RRR) and displaying expected rested days

I hope you are well .
I would like to request help for my current task.
I have to achieve what is marked in yellow below:

  1. Display the last rested date
  2. Count working days between two rested days
  3. Display the next resting date

My raw data looks like this in the image below:


051023_forum.pbix (17.8 KB)

I would be grateful for any help and guidance on my task.



Hi @Iwona ,

Thanks for posting the question.

I just wanted to know if is it going to be dynamic on your rest thing or number remains static and the filter will limit what we see.

Based on that i will look solution from M query side or DAX side.


Hi @Anurag ,

Many thanks for your help.

This solution is dedicated for few thousands employees with every day refresh of dataset.

This solution has to be dynamic,
Because it counts and resets to zero, then continue counting again in the same loop.

Would do you advise @Anurag in that case ?

Grateful as always,


Hi @Iwona ,

Thanks for replying . But that is not my question.

Let’s draw a scenario from your above-shared screenshot.

IF i pick 7/3/2023 as my date filter what will it show

Will it show the first line or the whole scenario change just because of that selection?

Hoping I made myself clear now.


I think I know what you mean now.

So the table should always show data for 90 last days .

Slicer will be used to choose one of the locations only.

90 days rolling would be a correct answer?

Thank you,


HI @Iwona ,

If this is what you are looking for I have attached the pbix in the post
I hope you can calculate the difference in date because I am not clear about its logic.

If this is not what we want let me know and in case you are not able to cal the difference then let me know the logic.

051023_forum_sol.pbix (24.4 KB)

Hi @Anurag

Please let me know if this explanation below makes more sense.

Grateful for your support in this matter.