It was at #24 because it dipped in the middle, but
Shadow Play (episode 28) was at 14th (17.6)
The Affair (episode 27) was at 14th (16.8)
The Confession (episode 26) was at 13th (16.9)
In the middle of the Sarah Curtis travesty, it was down to 40th (13.7) with "The Surgery" (episode 20) but it was gaining strength again once that was over.
I am afraid that you are wrong. Dynasty was falling from late January (after two "Singapoure episodes") to May 1987 with small exceptions of The Dress and The Sublet episodes. What about relatively satisfactory rakings of the last three episodes, be careful, bcs they were aired after 1986/87 season had ended, it means with possible lower competition. Rakings can be misleading, ratings are more accurate. The decision of ABC to move Dynasty into a new timeslot for 1987/88 season is understandable.
episode 7.16 - rating 18.9 (return from Singapoure, No. 16)
episode 7.17 - rating 18.2 (Krystina had health problems for the first time, No. 20)
episode 7.18 - rating 17.8
episode 7.19 - rating 16.9 (Sarah Curtis for the first time)
episode 7.20 - rating 13.7 (the lowest raking of the season as No. 40)
episode 7.21 - rating 16.5
episode 7.22 - rating 16.8
episode 7.23 - rating 18.6 (The Dress episode, back in TOP 20 as No. 16 or 17)
episode 7.24 - rating 16.3
episode 7.25 - rating 17.4 (looking for kidnapped Krystina, back in TOP 20, probably as No. 16)
OFFICIAL END OF SEASON 1986/87
episode 7.26 - rating 16.9
episode 7.27 - rating 16.8 (Sarah Curtis for the last time)
episode 7.28 - rating 17.6