cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Cookistador
Helper I
Helper I

Show days in month between two dates

Hi Everyone,

 

I have a table with a start date and end data for Employees/Trainees, and I would like to get the days that ressources are working for a company by month

So imagine, I have this kind of table:

 

   Name    Entry Date     Leave Date
Bob   01/01/2022   15/03/2022
Max   01/02/2022    30/04/2022

 

And I would like to get something like that:

   Name   Entry Date   Leave Date   JanuaryFebruaryMarchApril 
   Bob   01/01/2022   15/03/2022   31   28150
   Max   01/02/2022   30/04/2022   0283115

 

Any clues how can I achieve that?

 

Many thanks in adavance for your help

1 ACCEPTED SOLUTION
Manoj_Nair
Solution Supplier
Solution Supplier

@Cookistador - pls try this PBIX FILE, 

We worked on the power query part and taken into account only April Month to keep it simple and to give you an idea on one way to approach your requirement. You can replicate the same logic for other months.

Let me know how you are going about it. 

If this answered your question I would be happy if you could mark my post as a solution and give it a thumbs up

 

Best regards

Manoj Nair

Linkedin - https://www.linkedin.com/in/manoj-nair-%E2%98%81-344666104/

View solution in original post

1 REPLY 1
Manoj_Nair
Solution Supplier
Solution Supplier

@Cookistador - pls try this PBIX FILE, 

We worked on the power query part and taken into account only April Month to keep it simple and to give you an idea on one way to approach your requirement. You can replicate the same logic for other months.

Let me know how you are going about it. 

If this answered your question I would be happy if you could mark my post as a solution and give it a thumbs up

 

Best regards

Manoj Nair

Linkedin - https://www.linkedin.com/in/manoj-nair-%E2%98%81-344666104/

Helpful resources

Announcements
PBI Sept Update Carousel

Power BI September 2023 Update

Take a look at the September 2023 Power BI update to learn more.

Learn Live

Learn Live: Event Series

Join Microsoft Reactor and learn from developers.

Top Solution Authors