Cherry is basically right.
"You should have known this"
This is information you should have known at that time (but for some reason, you did not).
(Mom will be upset that you joined the army. You should have known this.)
(Why did you give him a peanut butter sandwich yesterday? Dad is allergic to peanuts. You should have known this.)
This is related to:
You should have known. (Dad should have told you, you were adopted.)
You should know better. (You're already 30 years old. Don't pick your nose.)
You should have known better. (Last Friday, you shouldn't have been driving after drinking.)