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

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

Reply
Hayoung
Helper IV
Helper IV

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 @Hayoung 
Please replace ALL('Table') with ALLEXCEPT ( 'Table', 'Table'[Name] )

View solution in original post

1 REPLY 1
tamerj1
Super User
Super User

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

Helpful resources

Announcements
LearnSurvey

Fabric certifications survey

Certification feedback opportunity for the community.

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.