Forum Discussion

Madhans's avatar
Madhans
Frequent Visitor
3 years ago
Solved

DAX Help - Mandays Calculation

I have one fact table containing 
Employee Clm, Joining-date Clm, Relieving-date Clm
 
And one calendar table.
 
Need to have the number of days in the particular period as below attached table visual for the year 2022    
 
Kind note- My slicer is from calendar table & Relieving date blank means still the employee is in the company 
And i want the days between column to be dynamic.
  • Hi,

    Please check the below picture and the attached pbix file.

     

     

     

     

     

    expected outcome measure: =
    COUNTROWS (
        FILTER (
            'Calendar',
            'Calendar'[Date] >= MAX ( Employee[Joined Date] )
                && IF (
                    NOT ISBLANK ( MAX ( Employee[Relieving Date] ) ),
                    'Calendar'[Date] <= MAX ( Employee[Relieving Date] ),
                    MAX ( 'Calendar'[Date] )
                )
        )
    )