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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Learn more

Reply
Anonymous
Not applicable

Calculate the variance for the last value for each name

I would like to create a measure to calculate the variance of second lastest date for each Name. I have tried 

variances(lastest) =
var _1 = CALCULATE(MAX('Table'[Date]),FILTER(ALL('Table'),'Table'[Date]<CALCULATE(MAX('Table'[Date]),ALL('Table'))))
var _2 = VARX.P(FILTER('Table',[Date]=_1),[Score])
return
_2
 
But it is not finding last date for each Name, but finding the last date for all Name. 
 

sample data:

Survey IDNameDateRespond IDScore
123A5/9/2021110
123A5/9/202128
123A5/9/202133
123A5/9/202140
234B8/9/202115
234B8/9/202125
234B8/9/2021310
234B8/9/202140
345A7/9/202212
345A7/9/202226
345A7/9/202238
345A7/9/202243
456B10/9/202211
456B10/9/2022210
456B10/9/202238
1 ACCEPTED SOLUTION
tamerj1
Super User
Super User

Hi @Anonymous 
Please replace ALL('Table') with ALLEXCEPT ( 'Table', 'Table'[Name] )

View solution in original post

1 REPLY 1
tamerj1
Super User
Super User

Hi @Anonymous 
Please replace ALL('Table') with ALLEXCEPT ( 'Table', 'Table'[Name] )

Helpful resources

Announcements
Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

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

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Solution Authors