Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
5 years ago
Solved

EOMONTH working days calculation

I have a measure to subtract the total number of days in a month e.g. 31 - absence.   Measure = VAR _lastday = DAY ( EOMONTH ( DATE ( LEFT ( MAX ( 'DimDate'[Month Year] ), 4 ), VALUE ( RIGHT ( ...
  • Fowmy's avatar
    Fowmy
    5 years ago

    Anonymous 

    The DimDate table has a column, Working Day, I used that as that is your basis for other measures:

    Please check now:

     

    Measure 3 = 
    
    VAR _Month = 
        EOMONTH (
            DATE ( LEFT ( MAX ( 'DimDate'[Month Year] ), 4 ), VALUE ( RIGHT ( MAX ( 'DimDate'[Month Year] ), 2 ) ), 1 ),
            0
        )
    VAR _lastday= 
    COUNTROWS(
        FILTER(
            DimDate,
            DimDate[Date] >= EDATE(_Month , -1)+1 && DimDate[Date] <= _Month && DimDate[WorkingDays] = TRUE())
    )    
    
    RETURN
    
     IF ( ISBLANK ( [AbsentByDay] ), BLANK (), _lastday ) - [AbsentByDay]

     

     

    ________________________

    If my answer was helpful, please consider Accept it as the solution to help the other members find it

    Click on the Thumbs-Up icon if you like this reply 🙂

    YouTube  LinkedIn