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

Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started

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
Fabcon_Europe_Social_Bogo

Europe’s largest Microsoft Fabric Community Conference

Join the community in Stockholm for expert Microsoft Fabric learning including a very exciting keynote from Arun Ulag, Corporate Vice President, Azure Data.

Power BI Carousel June 2024

Power BI Monthly Update - June 2024

Check out the June 2024 Power BI update to learn about new features.

RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

Ask questions in Eventhouse and KQL, Eventstream, and Reflex.