Forum Discussion
DAX Measure for Ranking the valid rows and calculating the average rating
- 4 months ago
Hi SRHR
Can you try these
Rank Valid Measure =
VAR LearningDate = SELECTEDVALUE(Attendance[Learning Date])
VAR Email = SELECTEDVALUE(Attendance[Email])
VAR FormKey = SELECTEDVALUE(Attendance[Form Key])
RETURN
IF(SELECTEDVALUE(Attendance[Status]) = "Completed" &&CALCULATE(
COUNTROWS(Survey),
FILTER(
Survey,
Survey[Email] = Email &&
Survey[Form Key] = FormKey &&
Survey[Survey Date] >= LearningDate &&
Survey[Survey Date] <= LearningDate + 2
) ) > 0,1,0)
Avg Rating Measure =
AVERAGEX(FILTER(
Survey,
VAR MatchLearningDate =
CALCULATE(MAX(Attendance[Learning Date]),
FILTER(
Attendance,
Attendance[Email] = Survey[Email] &&
Attendance[Form Key] = Survey[Form Key] && Attendance[Status] = "Completed"))
RETURN
NOT ISBLANK(MatchLearningDate) && Survey[Survey Date] >= MatchLearningDate &&
Survey[Survey Date] <= MatchLearningDate + 2),
Survey[Rating])
- 4 months ago
I understand the challenge of linking survey responses without a clear identifier.
Valid Survey Rank = CALCULATE ( COUNTROWS ( Survey ), FILTER ( Survey, Survey[Email] = EARLIER ( Attendance[Email] ) && Survey[Form Key] = EARLIER ( Attendance[Form Key] ) && Survey[Survey Date] > Attendance[Learning Date] ) )This formula counts survey responses where the date is after the learning date for the same email and form.
Hi @SRHR,
We would like to confirm if our community members answer resolves your query or if you need further help. If you still have any questions or need more support, please feel free to let us know. We are happy to help you.
Thank you for your patience and look forward to hearing from you.
Best Regards,
Prashanth Are
MS Fabric community support