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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
flinke
New Member

Need help with an overview of remaining holidays

Hello,

I hope you can help me - thanks in advance. I want to create a table of how many remaining holidays an employee has for that specific month with an extra field for the year that accounts the remaining holidays for the year by also considering the previous years. If you look at the table below you can see that there have been 3 days left for 2016. Though while having -2 days in total for 2017 in December 2017 the final result for 2017 will be 1 (considering the 3 days of 2016 --> 3-2=1). Same goes for 2018: the employee has 13 days left and 1 day remaining from 2017; therefore he will have a result of 14 days in 2018. The numbers in the month fields represent the amount of holidays left at that specific point in time for that year.

 

 2016-112016-12Remaining Days in 2016 2017-012017-022017-112017-12Remaining Days in 20172018-012018-022018-12Remaining Days in 2018
Employee A 10332020 17-212018 1314
1 REPLY 1
v-huizhn-msft
Employee
Employee

Hi @flinke,

I assume your source table have the Month, Year, left holidays columns. Please create a measure using the formula below.

Remaining Days =
VAR Year = Table1[Year]
RETURN
    CALCULATE (
        SUM ( Table1[left holidays] ),
        FILTER ( Table1, Table1[Year] <= Year && ( Table1[Month] ) = 12 )
    )


Best Regards,
Angelia

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

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

Top Solution Authors