Forum Discussion
usman96
Helper II
8 years agoRemaining Days of Month Calculation
I have this column which have dates , these dates show the day on which employees are "present" How to calculate absent days (other days which are not in this column) ? in powerbi
- Anonymous8 years ago
Hi usman96,
You can use below calculate column to achieve your requirement:
present = COUNTROWS ( FILTER ( ALL ( list ), YEAR ( [Date] ) = YEAR ( EARLIER ( list[Date] ) ) && MONTH ( [Date] ) = MONTH ( EARLIER ( list[Date] ) ) ) ) absent = DAY ( DATE ( YEAR ( [Date] ), MONTH ( [Date] ) + 1, 1 ) - 1 ) - [present]Result:
Regards,
Xiaoxin Sheng
Anonymous
8 years agoNot applicable
Hi usman96,
You can use below calculate column to achieve your requirement:
present =
COUNTROWS (
FILTER (
ALL ( list ),
YEAR ( [Date] ) = YEAR ( EARLIER ( list[Date] ) )
&& MONTH ( [Date] ) = MONTH ( EARLIER ( list[Date] ) )
)
)
absent =
DAY ( DATE ( YEAR ( [Date] ), MONTH ( [Date] ) + 1, 1 ) - 1 )
- [present]
Result:
Regards,
Xiaoxin Sheng