Forum Discussion
Anonymous
7 years agoNot applicable
Dax - using calculate, filter and lastdate
Hi there, I have a column of values called PF1.1.totalTime. I also have a column of dates corresponding to each value, this column is called UTC Finish Time. The column of dates has many repeated...
- 7 years ago
Anonymous you are getting caught into ROWCONTEXT, you need to understand why lastdate works when you throw on visual card but in DAX. Can you post sample data here and expected output and that will help to provide the solution.
Do you want LASTDATE across full dataset? Try following measure
Measure = VAR __lastDate=CALCULATE( LASTDATE('All PF1 Data (2)'[UTC Finish Time]), ALL() ) RETURN CALCULATE(PERCENTILE.INC('All PF1 Data (2)'[PF1.1.totalTime],0.95), 'All PF1 Data (2)'[UTC Finish Time] = __lastDate)
parry2k
Super User
7 years agoAnonymous you are getting caught into ROWCONTEXT, you need to understand why lastdate works when you throw on visual card but in DAX. Can you post sample data here and expected output and that will help to provide the solution.
Do you want LASTDATE across full dataset? Try following measure
Measure =
VAR __lastDate=CALCULATE( LASTDATE('All PF1 Data (2)'[UTC Finish Time]), ALL() )
RETURN
CALCULATE(PERCENTILE.INC('All PF1 Data (2)'[PF1.1.totalTime],0.95),
'All PF1 Data (2)'[UTC Finish Time] = __lastDate)Anonymous
7 years agoNot applicable
Thank you parry2k! Could you explain the difference in what I did compared to what your formula does? Struggling to differentiate the logic. Many thanks.