Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
8 years ago
Solved

Calculate total on last return date

Hi

 

I'm trying to calculate the number of employees per customer.  I am struggling with calculating the number of employees as the companies submitted a return sometimes quarterly or even annually.  I need to calculate the number of employees from the last return.  Below is sample anoymised data so for example the total for company A would be 16 but for company C it would be 116 from return date 31/12/2017.  Any ideas on how to do this in DAX would be much appreciated.  Thanks in advance.

 

Company               No of Employees    Return Date

A1631/12/2017 00:00
B131/12/2017 00:00
C11631/12/2017 00:00
C11830/09/2017 00:00
C12430/06/2017 00:00
C12531/03/2017 00:00
D2527/09/2017 00:00
E231/05/2017 00:00
F503/08/2017 00:00
G010/03/2017 00:00
H42131/12/2017 00:00
H44030/09/2017 00:00
H44830/06/2017 00:00
H45431/03/2017 00:00
I530/04/2017 00:00
J19602/10/2017 00:00
J63201/10/2017 00:00
J64901/01/2017 00:00
J65501/04/2017 00:00
J655

01/07/2017 00:00

 

5 Replies

  • Zubair_Muhammad's avatar
    Zubair_Muhammad
    Icon for Community Champion rankCommunity Champion

    HI Anonymous

     

    Try this MEASURE

     

    Measure =
    CALCULATE ( SUM ( Table1[No of employees] ), LASTDATE ( Table1[Return Date] ) )
  • v-piga-msft's avatar
    v-piga-msft
    Icon for Resident Rockstar rankResident Rockstar

    Hi Anonymous,

     

    Have you solved your problem with the reply from Zubair_Muhammad?

     

    If you have solved your problem, please always accept the replies making sense as solution to your question so that people who may have the same question can get the solution directly.

     

    If you still need help, please share your expected output so that we can help further investigate on it?

     

    Best Regards,

    Cherry