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
_Melenios_
Helper I
Helper I

Calculate Employee Scheduled Hrs Until Resignation Date

Hi amazing team,

 

Need some of your expertise with the following issue.

 

I have Table1 that holds generic employee info and a specific "ResignDate" column( which is blank if N/A).

Then i have Table2 which holds "scheduled_Hrs" for the employees for each date.

 

What i'd like here since i have schedules for a 6 months (or more) period,  is to have a measure that sums the Hrs and  also counts scheduled days  only until the employee's "ResignDate" (if that exists in Table1.) otherwise return the sum Hrs and Count days as normal.

 

Thanks in advance for any sugestions!

 

 

 

 

1 ACCEPTED SOLUTION
johnt75
Super User
Super User

Try

Hours until resign =
SUMX (
    FILTER (
        'Table2',
        VAR ResignDate =
            RELATED ( 'Table1'[Resign date] )
        RETURN
            ISBLANK ( ResignDate )
                || 'Table2'[Date] <= ResignDate
    ),
    'Table2'[Scheduled hours]
)

View solution in original post

2 REPLIES 2
johnt75
Super User
Super User

Try

Hours until resign =
SUMX (
    FILTER (
        'Table2',
        VAR ResignDate =
            RELATED ( 'Table1'[Resign date] )
        RETURN
            ISBLANK ( ResignDate )
                || 'Table2'[Date] <= ResignDate
    ),
    'Table2'[Scheduled hours]
)

Thanks @johnt75  

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.