Forum Discussion
DAX Measure help! % calculation
- 6 years ago
Here is one way to approach this one
% Students Career Day First = VAR __summarytable = ADDCOLUMNS ( VALUES ( Students[StudentID] ), "@AppDate", CALCULATE ( MIN ( Applications[Date] ) ), "@MinCareerDay", CALCULATE ( MIN ( Events[Date] ), Events[Type] = "Careers Day" ) ) RETURN DIVIDE ( COUNTROWS ( FILTER ( __summarytable, [@MinCareerDay] < [@AppDate] ) ), COUNTROWS ( __summarytable ) )If this works for you, please mark it as the solution. Kudos are appreciated too. Please let me know if not.
Regards,
Pat
Hi Pat mahoneypat
You are a star, thank you! However - the Event Date is on the Event, and I need to return the Students with an Event Responses where the related Event's date is before the earliest application date. I'm not sure the @ MinOpenDay is doing this? What do you think?
I have, however, pulled the related Event's date onto each Event Response with a calculated column, so I now have:
Event Responses [Event Date] as a calculated column,
as well as Students[EarliestApplicationDate] to avoid needing to evaluate across all Students' application records. This could simplify the measure but wouldn't work as well with a summary table no?
I think it is doing that comparison in the filter part in the return statement. Please let me know if you are getting incorrect results.
Regards
Pat