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

To celebrate FabCon Vienna, we are offering 50% off select exams. Ends October 3rd. Request your discount now.

Reply
bourne2000
Helper V
Helper V

How to create a calendar table for two date columns?

Hi

 

I am building an HR Analytics dashboard. My data has the Employee joining date and the Employee leaving date. I would like to do an analysis using employee joining and leaving dates. 

 

I wanted to create a separate Calendar column, however, not sure how to do it for both date columns. Can anyone advise how to do this?

1 ACCEPTED SOLUTION

Your test data was incorrect.  Your leaving date was before the joining data - i made that correction.  Download the PBI file from here.

The next time you share data, please atleast ensure that you share logical data.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/

View solution in original post

7 REPLIES 7
bourne2000
Helper V
Helper V

@Ashish_Mathur 

 

Thanks for your quick reply. I am getting an error. 

 

{Number.From([Joining Date])..Number.From([Leaving date])}  --> What this forumla doing? Is it subtracting the joining and leaving date? 

 

I also wanted to do an analysis separately on leaving and joining dates, I might be using a date slicer for both joining and leaving dates on separate page. Can you please advise whether the above formula works for this?. Sorry I am a novice to the Power BI

Hi,

Share the link from where i can download your PBI file.  If you imported data in the PBI file from an MS Excel file, then i will need that MS Excel file as well.  If data is confidential, then please anonymise the data before sharing the download link.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/

@Ashish_Mathur  Thanks. Please find the pbix and excel file. I gave some test data

 

You can download the file from the below link,

 

https://we.tl/t-5ZgcI0FvZ2

Your test data was incorrect.  Your leaving date was before the joining data - i made that correction.  Download the PBI file from here.

The next time you share data, please atleast ensure that you share logical data.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/

@Ashish_Mathur  Thanks for your support yesterday. I tried to replicate the same in my data. I am getting the below error,

 

bourne2000_0-1623038222005.png

 

 

 

{Number.From([Hire Date])..Number.From([Terminated date])}

 

Can you please advise?

 

 

Hi,

Maybe your systems understand the mm/dd/yyyy format (not the dd/mm/yyyy format).  In the source Excel document, ensure that all dates are entered (not just formatted) in the mm/dd/yyyy format.  


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/
Ashish_Mathur
Super User
Super User

Hi,

In the Query Editor, you should write this custom column formula

={Number.From([Joining Date])..Number.From([Leaving date])}

This will create an additional column with one date per cell between the Joining date and Leaving date.  Your Calendar Table should then be related to this Date column.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/

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.

August 2025 community update carousel

Fabric Community Update - August 2025

Find out what's new and trending in the Fabric community.

Top Solution Authors
Top Kudoed Authors