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

The Power BI DataViz World Championships are on! With four chances to enter, you could win a spot in the LIVE Grand Finale in Las Vegas. Show off your skills.

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
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

FebPBI_Carousel

Power BI Monthly Update - February 2025

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

Feb2025 NL Carousel

Fabric Community Update - February 2025

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

Top Kudoed Authors