Someone asked this question on Power BI Community forum and I think it will be a good learning for those who are new to DAX as when I was starting to learn it was unclear for a very long time that how 2 similar expression are calculating differently.
CALCULATE, CALCULATE filter arguments, filter expansion, KEEPFILTERS.