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
Anonymous
Not applicable

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

 

1 ACCEPTED SOLUTION

@Anonymous

 

Please see attached file

 

lastreturn.png

 


Regards
Zubair

Please try my custom visuals

View solution in original post

5 REPLIES 5
v-piga-msft
Resident Rockstar
Resident 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

Community Support Team _ Cherry Gao
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Zubair_Muhammad
Community Champion
Community Champion

HI @Anonymous

 

Try this MEASURE

 

Measure =
CALCULATE ( SUM ( Table1[No of employees] ), LASTDATE ( Table1[Return Date] ) )

Regards
Zubair

Please try my custom visuals

@Anonymous

 

Please see attached file

 

lastreturn.png

 


Regards
Zubair

Please try my custom visuals
Anonymous
Not applicable

Thank you @Zubair_Muhammad - this works perfectly.

 

Kind regards

 

 

Anonymous
Not applicable

Hello

 

Just building on my previous question

 

how would I calculate the total on the return data previous to the last date?

 

Thanks

 

Jo.

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.