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

Power BI is turning 10! Let’s celebrate together with dataviz contests, interactive sessions, and giveaways. Register now.

Reply
JB_AT
Helper III
Helper III

Calculating correct FTE

Hi

 

I have a table with EmpID, FTE, FromDate, ToDate. 

 

There are multiple rows for each employee and the FTE for that employee appears multiple times, so my runningtotal returns the wrong result. This is due to record ending and starting in the same month and the RT calculate both Values.

I thought I had solved the issue by getting the most recent FTE with this measure and using this in my Running Total measure, but it doesn't consider all records.

FTE = 
    CALCULATE(
        LASTNONBLANK(Employment[FTE], 1)

 
Does anyone know how I can approach this issue?

 

Thanks

 

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi @JB_AT 

 

@Sahir_Maharaj  Good share! Here we provide another method:

 

Here's some dummy data

 

“DATE”

vnuocmsft_0-1703753019129.png

 

“Employment”

vnuocmsft_1-1703753028059.png

 

Create measures. Querying the "FTE" for the latest date,

vnuocmsft_2-1703753040758.png

 

VALUE_FTE = var max_date = MAX('DATE'[Date])
 VAR FromDate = SELECTEDVALUE(Employment[FromDate])
 var ToDate = SELECTEDVALUE(Employment[ToDate])
 var fteeee = SELECTEDVALUE(Employment[FTE])
 var result_fte =  IF(FromDate <= max_date && ToDate >= max_date, fteeee, BLANK())
RETURN result_fte

 

Calculate the FTE, and here is the result.

vnuocmsft_3-1703753050549.png

RESULT = CALCULATE(sum(Employment[FTE]), FILTER(ALL(Employment), 'Employment'[FTE] = [VALUE_FTE]))

 

If you're still having problems, provide some dummy data and the desired outcome. It is best presented in the form of a table.

 

Best Regards,

Nono Chen

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

 

 

 

View solution in original post

2 REPLIES 2
Anonymous
Not applicable

Hi @JB_AT 

 

@Sahir_Maharaj  Good share! Here we provide another method:

 

Here's some dummy data

 

“DATE”

vnuocmsft_0-1703753019129.png

 

“Employment”

vnuocmsft_1-1703753028059.png

 

Create measures. Querying the "FTE" for the latest date,

vnuocmsft_2-1703753040758.png

 

VALUE_FTE = var max_date = MAX('DATE'[Date])
 VAR FromDate = SELECTEDVALUE(Employment[FromDate])
 var ToDate = SELECTEDVALUE(Employment[ToDate])
 var fteeee = SELECTEDVALUE(Employment[FTE])
 var result_fte =  IF(FromDate <= max_date && ToDate >= max_date, fteeee, BLANK())
RETURN result_fte

 

Calculate the FTE, and here is the result.

vnuocmsft_3-1703753050549.png

RESULT = CALCULATE(sum(Employment[FTE]), FILTER(ALL(Employment), 'Employment'[FTE] = [VALUE_FTE]))

 

If you're still having problems, provide some dummy data and the desired outcome. It is best presented in the form of a table.

 

Best Regards,

Nono Chen

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

 

 

 

Sahir_Maharaj
Super User
Super User

Hello @JB_AT,

 

Your current method using LASTNONBLANK retrieves the most recent FTE value, but it might not accurately account for all records, especially in cases of overlapping/concurrent date ranges. Can you please try this:

Daily FTE = 
CALCULATE(
    SUM(Employment[FTE]),
    FILTER(
        Employment,
        Employment[FromDate] <= MAX(DateTable[Date]) &&
        Employment[ToDate] >= MAX(DateTable[Date])
    )
)

Did I answer your question? Mark my post as a solution, this will help others!

If my response(s) assisted you in any way, don't forget to drop me a "Kudos" 🙂

Kind Regards,
Sahir Maharaj
Data Scientist | Data Engineer | Data Analyst | AI Engineer
P.S. Want me to build your Power BI solution? (Yes, its FREE!)
➤ Lets connect on LinkedIn: Join my network of 15K+ professionals
➤ Join my free newsletter: Data Driven: From 0 to 100
➤ Website: https://sahirmaharaj.com
➤ Email: sahir@sahirmaharaj.com
➤ Want me to build your Power BI solution? Lets chat about how I can assist!
➤ Join my Medium community of 30K readers! Sharing my knowledge about data science and artificial intelligence
➤ Explore my latest project (350K+ views): Wordlit.net
➤ 100+ FREE Power BI Themes: Download Now
LinkedIn Top Voice in Artificial Intelligence, Data Science and Machine Learning

Helpful resources

Announcements
June 2025 Power BI Update Carousel

Power BI Monthly Update - June 2025

Check out the June 2025 Power BI update to learn about new features.

June 2025 community update carousel

Fabric Community Update - June 2025

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