Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
8 years ago

Team Leave Calendar - Annual Leave

Hi All,

 

Has anyone been able to successful create a calendar visualisation that shows a teams annual leave and the days they are on leave?

 

I have downloaded a couple of the calendar visualisation apps but unfortunately doesn't seem to 

 

Any ideas or suggestions would be great!

 

Below is the code I have pulled together the dates between a Start Date and End Data in a table as well as the employees name. 

 

Leave Expanded = SELECTCOLUMNS(
                          FILTER(
    				 CROSSJOIN(Query6,'Date') ,
	           		'Query6'[StartDate].[Date] <= 'Date'[Date]
                                &&  'Query6'[EndDate].[Date] >= 'Date'[Date]
                            ),
                            "Employee Name" , 'Query6'[EmployeeName],
                            "Is On Leave" ,'Date'[Date]
                            )

10 Replies

  • v-jiascu-msft's avatar
    v-jiascu-msft
    Icon for Microsoft Employee rankMicrosoft Employee

    Hi Anonymous,

     

    What's the expected result? It seems your formula should work. Please download the demo in the attachment. 

    1. The solution in a measure.

    Measure =
    IF (
        MIN ( 'Date'[Date] ) >= MIN ( Query6[StartDate] )
            && MIN ( 'Date'[Date] ) <= MIN ( Query6[EndDate] ),
        "On leave",
        BLANK ()
    )
    

    Team-Leave-Calendar-Annual-Leave

    2. The solution in a calculated table.

     

    Table =
    FILTER (
        CROSSJOIN ( 'Date', Query6 ),
        [StartDate] <= [Date]
            && Query6[EndDate] >= [Date]
    )
    

     

    Best Regards,
    Dale

  • v-jiascu-msft's avatar
    v-jiascu-msft
    Icon for Microsoft Employee rankMicrosoft Employee

    Hi Anonymous,

     

    Could you please mark the proper answers as solutions?

     

    Best Regards,

    Dale

    • robhel's avatar
      robhel
      Icon for Helper I rankHelper I

      Hi Anonymous

       

      I am currently working on developing a visual employee calendar for leave for over 1500 employees nationally and 30+ type of leave for full time & part time staff - if this is what you are looking for, let me know and I'll provide further details of how I hacked my way through it - which I really do mean hacked 

       

      • Anonymous's avatar
        Anonymous
        Not applicable

        Hi robhel,

         

        I am trying to achieve a visual which is almost exactly what you have done.  Do you mind sharing with me how you did it?

         

        Thanks,

        Andrew